Reduce dependencies on QtGraphicalEffects
- Make QtGraphicalEffects optional in tests - Mention that QtGraphicalEffects is required for relevant examples Change-Id: I3ac7d06add931e0a10c3df7edc4e458ba5519c75 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
5e46b5bb61
commit
5a61d637e0
|
@ -36,6 +36,8 @@
|
|||
This example demonstrates how custom Imagine style assets can be used to
|
||||
style an automotive user interface.
|
||||
|
||||
\note This example requires \l {Qt Graphical Effects}.
|
||||
|
||||
\image qtquickcontrols2-automotive.png
|
||||
|
||||
\include examples-run.qdocinc
|
||||
|
|
|
@ -763,6 +763,9 @@ void tst_QQuickApplicationWindow::focusAfterPopupClosed()
|
|||
|
||||
void tst_QQuickApplicationWindow::clearFocusOnDestruction()
|
||||
{
|
||||
if (!canImportModule("import QtGraphicalEffects 1.15; DropShadow {}"))
|
||||
QSKIP("Test requires QtGraphicalEffects");
|
||||
|
||||
QQmlEngine engine;
|
||||
QQmlComponent component(&engine);
|
||||
component.loadUrl(testFileUrl("clearfocusondestruction.qml"));
|
||||
|
|
|
@ -1266,6 +1266,9 @@ void tst_QQuickPopup::countChanged()
|
|||
// QTBUG-73243
|
||||
void tst_QQuickPopup::toolTipCrashOnClose()
|
||||
{
|
||||
if (!canImportModule("import QtGraphicalEffects 1.15; DropShadow {}"))
|
||||
QSKIP("Test requires QtGraphicalEffects");
|
||||
|
||||
QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
|
||||
|
||||
QQuickWindow *window = helper.window;
|
||||
|
|
|
@ -108,6 +108,14 @@ QByteArray QQmlDataTest::msgComponentError(const QQmlComponent &c,
|
|||
return result.toLocal8Bit();
|
||||
}
|
||||
|
||||
bool QQmlDataTest::canImportModule(const QString &importTestQmlSource) const
|
||||
{
|
||||
QQmlEngine engine;
|
||||
QQmlComponent component(&engine);
|
||||
component.setData(importTestQmlSource.toLatin1(), QUrl());
|
||||
return !component.isError();
|
||||
}
|
||||
|
||||
Q_GLOBAL_STATIC(QMutex, qQmlTestMessageHandlerMutex)
|
||||
|
||||
QQmlTestMessageHandler *QQmlTestMessageHandler::m_instance = 0;
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
static QByteArray msgComponentError(const QQmlComponent &,
|
||||
const QQmlEngine *engine = 0);
|
||||
|
||||
bool canImportModule(const QString &importTestQmlSource) const;
|
||||
|
||||
public slots:
|
||||
virtual void initTestCase();
|
||||
|
||||
|
|
Loading…
Reference in New Issue