Fix QmltcTests compilation when tableview or gridview is disabled
Put two of the QML files behind appropriate feature flags (they use TableView and GridView). Similarly guard the cpp side includes and access to the genrated QML type. As a drive-by add include guard when qml-table-model is disabled. Task-number: QTBUG-136101 Pick-to: 6.9 6.8 Change-Id: Ic643ccb3f8346fc650afe5d863b575e8cec2f57a Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
This commit is contained in:
parent
f4c2eeac6a
commit
cc98876fea
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue