diff options
-rw-r--r-- | tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.h | 5 |
3 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt index 3eab68a7e7..3bb8133e9b 100644 --- a/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt +++ b/tests/auto/qml/qmltc/QmltcTests/CMakeLists.txt @@ -33,9 +33,7 @@ set(qml_sources simpleQtQuickTypes.qml typeWithEnums.qml methods.qml - properties.qml ObjectWithId.qml - documentWithIds.qml importNamespace.qml gradients.qml qjsvalueAssignments.qml @@ -161,6 +159,13 @@ set(common_libraries Qt::Gui # QColor, QMatrix4x4, ... ) +if(QT_FEATURE_quick_tableview) + list(APPEND qml_sources properties.qml) + if(QT_FEATURE_quick_gridview) + list(APPEND qml_sources documentWithIds.qml) + endif() +endif() + if (QT_FEATURE_qml_table_model) list(APPEND qml_sources QmlTableModel.qml) list(APPEND common_libraries Qt::LabsQmlModelsPrivate) diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp index 73ef03eaaf..d2fcab4658 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.cpp +++ b/tests/auto/qml/qmltc/tst_qmltc.cpp @@ -9,9 +9,13 @@ #include "simpleqtquicktypes.h" #include "typewithenums.h" #include "methods.h" +#if QT_CONFIG(quick_tableview) #include "properties.h" +#endif #include "objectwithid.h" +#if QT_CONFIG(quick_gridview) #include "documentwithids.h" +#endif #include "importnamespace.h" #include "deferredproperties.h" #include "deferredproperties_group.h" @@ -87,7 +91,9 @@ #include "mysignals.h" #include "namespacedtypes.h" #include "type.h" +#if QT_CONFIG(qml_table_model) #include "qmltablemodel.h" +#endif #include "stringtourl.h" #include "signalconnections.h" #include "requiredproperties.h" @@ -334,6 +340,7 @@ void tst_qmltc::methods() QCOMPARE(metaTypedMethod.parameterNames(), QList<QByteArray>({ "a", "b" })); } +#if QT_CONFIG(quick_tableview) void tst_qmltc::properties() { QQmlEngine e; @@ -478,7 +485,9 @@ void tst_qmltc::properties() QVERIFY(sentinelForComponent); QCOMPARE(sentinelForComponent->property("text").toString(), u"should be correctly created"_s); } +#endif // QT_CONFIG(quick_tableview) +#if QT_CONFIG(quick_tableview) && QT_CONFIG(quick_gridview) void tst_qmltc::ids() { { @@ -575,6 +584,7 @@ void tst_qmltc::ids() verifyComponent(afterChild, QString(), u"afterDelegateDefaultPropertyText"_s); } } +#endif // QT_CONFIG(quick_tableview) && QT_CONFIG(quick_gridview) void tst_qmltc::importNamespace() { diff --git a/tests/auto/qml/qmltc/tst_qmltc.h b/tests/auto/qml/qmltc/tst_qmltc.h index 99abb60dc5..17a464bdb2 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.h +++ b/tests/auto/qml/qmltc/tst_qmltc.h @@ -3,6 +3,7 @@ #include <qtest.h> #include <private/qtqmlmodelsglobal_p.h> +#include <private/qtquick-config_p.h> // For feature definitions using namespace Qt::StringLiterals; @@ -27,8 +28,12 @@ private slots: void qtQuickIncludes(); void enumerations(); void methods(); +#if QT_CONFIG(quick_tableview) void properties(); +#if QT_CONFIG(quick_gridview) void ids(); +#endif +#endif void importNamespace(); void deferredProperties(); void gradients(); // QTBUG-102560 |