aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/layouts/plugin.cpp3
-rw-r--r--src/imports/localstorage/plugin.cpp3
-rw-r--r--src/imports/models/plugin.cpp4
-rw-r--r--src/imports/particles/plugin.cpp4
-rw-r--r--src/imports/statemachine/plugin.cpp3
-rw-r--r--src/imports/statemachine/signaltransition.cpp7
-rw-r--r--src/imports/testlib/main.cpp3
-rw-r--r--src/imports/window/plugin.cpp3
-rw-r--r--src/imports/xmllistmodel/plugin.cpp3
-rw-r--r--src/qml/configure.json9
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp12
-rw-r--r--src/qml/qml/qqmlengine.cpp10
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp8
-rw-r--r--src/qml/types/qqmlconnections.cpp7
-rw-r--r--src/qml/types/qqmldelegatemodel_p.h2
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h2
-rw-r--r--src/qml/types/qqmlinstantiator.cpp27
-rw-r--r--src/qml/types/qqmlinstantiator_p_p.h4
-rw-r--r--src/qml/types/qqmlmodelsmodule.cpp4
-rw-r--r--src/qml/types/types.pri12
-rw-r--r--src/qml/util/qqmladaptormodel_p.h2
-rw-r--r--src/qml/util/util.pri10
-rw-r--r--src/quick/configure.json8
-rw-r--r--src/quick/designer/qquickdesignercustomobjectdata.cpp12
-rw-r--r--src/quick/designer/qquickdesignersupportitems.cpp13
-rw-r--r--src/quick/designer/qquickdesignersupportproperties.cpp11
26 files changed, 155 insertions, 31 deletions
diff --git a/src/imports/layouts/plugin.cpp b/src/imports/layouts/plugin.cpp
index 25d5bacc90..c805c9fb43 100644
--- a/src/imports/layouts/plugin.cpp
+++ b/src/imports/layouts/plugin.cpp
@@ -75,6 +75,9 @@ public:
qmlRegisterUncreatableType<QQuickLayout>(uri, 1, 2, "Layout",
QStringLiteral("Do not create objects of type Layout"));
qmlRegisterRevision<QQuickGridLayoutBase, 1>(uri, 1, 1);
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
}
};
//![class decl]
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 88121df66c..fb71fcaff6 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -820,6 +820,9 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.LocalStorage"));
qmlRegisterSingletonType<QQuickLocalStorage>(uri, 2, 0, "LocalStorage", module_api_factory);
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};
diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp
index 2f8a9713d2..fb1d42e85e 100644
--- a/src/imports/models/plugin.cpp
+++ b/src/imports/models/plugin.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
#include <private/qqmlmodelsmodule_p.h>
@@ -83,6 +84,9 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models"));
Q_UNUSED(uri);
QQmlModelsModule::defineModule();
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};
//![class decl]
diff --git a/src/imports/particles/plugin.cpp b/src/imports/particles/plugin.cpp
index a04e115976..d548f26599 100644
--- a/src/imports/particles/plugin.cpp
+++ b/src/imports/particles/plugin.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
#include <private/qquickparticlesmodule_p.h>
@@ -62,6 +63,9 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Particles"));
Q_UNUSED(uri);
QQuickParticlesModule::defineModule();
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};
//![class decl]
diff --git a/src/imports/statemachine/plugin.cpp b/src/imports/statemachine/plugin.cpp
index 1357743126..93ced6e280 100644
--- a/src/imports/statemachine/plugin.cpp
+++ b/src/imports/statemachine/plugin.cpp
@@ -75,6 +75,9 @@ public:
qmlRegisterCustomType<SignalTransition>(uri, 1, 0, "SignalTransition", new SignalTransitionParser);
qmlRegisterType<TimeoutTransition>(uri, 1, 0, "TimeoutTransition");
qmlProtectModule(uri, 1);
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
}
};
diff --git a/src/imports/statemachine/signaltransition.cpp b/src/imports/statemachine/signaltransition.cpp
index 63a969c0e8..ab625788bb 100644
--- a/src/imports/statemachine/signaltransition.cpp
+++ b/src/imports/statemachine/signaltransition.cpp
@@ -176,9 +176,10 @@ void SignalTransition::connectTriggered()
QMetaMethod metaMethod = target->metaObject()->method(qobjectSignal->methodIndex());
int signalIndex = QMetaObjectPrivate::signalIndex(metaMethod);
- QQmlBoundSignalExpression *expression = ctxtdata ?
- new QQmlBoundSignalExpression(target, signalIndex,
- ctxtdata, this, m_compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex]) : nullptr;
+ auto f = m_compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex];
+ QQmlBoundSignalExpression *expression =
+ ctxtdata ? new QQmlBoundSignalExpression(target, signalIndex, ctxtdata, this, f)
+ : nullptr;
if (expression)
expression->setNotifyOnValueChanged(false);
m_signalExpression = expression;
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index 45e9bd2cf6..443229bee9 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -160,6 +160,9 @@ public:
qmlRegisterType<QuickTestEvent>(uri,1,2,"TestEvent");
qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil");
qmlRegisterType<QQuickTouchEventSequence>();
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 1, QT_VERSION_MINOR);
}
};
diff --git a/src/imports/window/plugin.cpp b/src/imports/window/plugin.cpp
index 4e6eedf326..d8d21ce27e 100644
--- a/src/imports/window/plugin.cpp
+++ b/src/imports/window/plugin.cpp
@@ -78,6 +78,9 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Window"));
Q_UNUSED(uri);
QQuickWindowModule::defineModule();
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};
//![class decl]
diff --git a/src/imports/xmllistmodel/plugin.cpp b/src/imports/xmllistmodel/plugin.cpp
index dc6a02918b..82e11eeeb3 100644
--- a/src/imports/xmllistmodel/plugin.cpp
+++ b/src/imports/xmllistmodel/plugin.cpp
@@ -63,6 +63,9 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.XmlListModel"));
qmlRegisterType<QQuickXmlListModel>(uri,2,0,"XmlListModel");
qmlRegisterType<QQuickXmlListModelRole>(uri,2,0,"XmlRole");
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule(uri, 2, QT_VERSION_MINOR);
}
};
diff --git a/src/qml/configure.json b/src/qml/configure.json
index 47b897ce27..7d67db8b2c 100644
--- a/src/qml/configure.json
+++ b/src/qml/configure.json
@@ -80,6 +80,12 @@
"section": "QML",
"condition": "features.animation",
"output": [ "privateFeature" ]
+ },
+ "qml-delegate-model": {
+ "label": "QML delegate model",
+ "purpose": "Provides the DelegateModel QML type.",
+ "section": "QML",
+ "output": [ "privateFeature" ]
}
},
@@ -92,7 +98,8 @@
"qml-sequence-object",
"qml-list-model",
"qml-xml-http-request",
- "qml-locale"
+ "qml-locale",
+ "qml-delegate-model"
]
}
]
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index 060706ac50..d5117c8cec 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -110,6 +110,12 @@ QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index,
m_index(index),
m_target(target)
{
+ // If the function is marked as having a nested function, then the user wrote:
+ // onSomeSignal: function() { /*....*/ }
+ // So take that nested function:
+ if (auto closure = function->nestedFunction())
+ function = closure;
+
setupFunction(scope, function);
init(ctxt, scopeObject);
}
@@ -122,6 +128,12 @@ QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index,
// It's important to call init first, because m_index gets remapped in case of cloned signals.
init(ctxt, scope);
+ // If the function is marked as having a nested function, then the user wrote:
+ // onSomeSignal: function() { /*....*/ }
+ // So take that nested function:
+ if (auto closure = runtimeFunction->nestedFunction())
+ runtimeFunction = closure;
+
QV4::ExecutionEngine *engine = ctxt->engine->handle();
QList<QByteArray> signalParameters = QMetaObjectPrivate::signal(m_target->metaObject(), m_index).parameterNames();
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index d7c03115f2..79e9699df0 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -91,7 +91,9 @@
#endif
#include <private/qqmlplatform_p.h>
#include <private/qquickpackage_p.h>
+#if QT_CONFIG(qml_delegate_model)
#include <private/qqmldelegatemodel_p.h>
+#endif
#include <private/qqmlobjectmodel_p.h>
#include <private/qquickworkerscript_p.h>
#include <private/qqmlinstantiator_p.h>
@@ -245,8 +247,10 @@ void QQmlEnginePrivate::registerQtQuick2Types(const char *uri, int versionMajor,
#endif
qmlRegisterType<QQuickWorkerScript>(uri, versionMajor, versionMinor, "WorkerScript");
qmlRegisterType<QQuickPackage>(uri, versionMajor, versionMinor, "Package");
+#if QT_CONFIG(qml_delegate_model)
qmlRegisterType<QQmlDelegateModel>(uri, versionMajor, versionMinor, "VisualDataModel");
qmlRegisterType<QQmlDelegateModelGroup>(uri, versionMajor, versionMinor, "VisualDataGroup");
+#endif
qmlRegisterType<QQmlObjectModel>(uri, versionMajor, versionMinor, "VisualItemModel");
}
@@ -260,6 +264,9 @@ void QQmlEnginePrivate::defineQtQuick2Module()
#if QT_CONFIG(qml_locale)
qmlRegisterUncreatableType<QQmlLocale>("QtQuick", 2, 0, "Locale", QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()"));
#endif
+
+ // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward
+ qmlRegisterModule("QtQuick", 2, QT_VERSION_MINOR);
}
bool QQmlEnginePrivate::designerMode()
@@ -961,6 +968,9 @@ void QQmlEnginePrivate::init()
qmlRegisterUncreatableType<QQmlLocale>("QtQml", 2, 2, "Locale", QQmlEngine::tr("Locale cannot be instantiated. Use Qt.locale()"));
#endif
+ // Auto-increment the import to stay in sync with ALL future QtQml minor versions from 5.11 onward
+ qmlRegisterModule("QtQml", 2, QT_VERSION_MINOR);
+
QQmlData::init();
baseModulesUninitialized = false;
}
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 7c36f59035..7051fb51da 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -879,14 +879,6 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *bindingProper
if (binding->type == QV4::CompiledData::Binding::Type_Script || binding->containsTranslations()) {
if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) {
QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex];
-
- // When a user writes the following:
- // onSignal: function() { doSomethingUsefull }
- // then do not run the binding that returns the closure, but run the closure
- // instead.
- if (auto closure = runtimeFunction->nestedFunction())
- runtimeFunction = closure;
-
int signalIndex = _propertyCache->methodIndexToSignalIndex(bindingProperty->coreIndex());
QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine);
QQmlBoundSignalExpression *expr = new QQmlBoundSignalExpression(_bindingTarget, signalIndex,
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index d1a7aa9b6f..2ae3df6ebb 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -289,13 +289,6 @@ void QQmlConnections::connectSignals()
signal->setEnabled(d->enabled);
auto f = d->compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex];
-
- // If the function is marked as having a nested function, then the user wrote:
- // onSomeSignal: function() { /*....*/ }
- // So take that nested function:
- if (auto closure = f->nestedFunction())
- f = closure;
-
QQmlBoundSignalExpression *expression =
ctxtdata ? new QQmlBoundSignalExpression(target, signalIndex, ctxtdata, this, f)
: nullptr;
diff --git a/src/qml/types/qqmldelegatemodel_p.h b/src/qml/types/qqmldelegatemodel_p.h
index 439d5c9d37..707aaeaa4b 100644
--- a/src/qml/types/qqmldelegatemodel_p.h
+++ b/src/qml/types/qqmldelegatemodel_p.h
@@ -62,6 +62,8 @@
#include <private/qv8engine_p.h>
#include <private/qqmlglobal_p.h>
+QT_REQUIRE_CONFIG(qml_delegate_model);
+
QT_BEGIN_NAMESPACE
class QQmlChangeSet;
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 9f1c9d31a4..42481be34f 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -60,6 +60,8 @@
// We mean it.
//
+QT_REQUIRE_CONFIG(qml_delegate_model);
+
QT_BEGIN_NAMESPACE
typedef QQmlListCompositor Compositor;
diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp
index 213bef7879..030758fa3b 100644
--- a/src/qml/types/qqmlinstantiator.cpp
+++ b/src/qml/types/qqmlinstantiator.cpp
@@ -44,7 +44,9 @@
#include <QtQml/QQmlInfo>
#include <QtQml/QQmlError>
#include <QtQml/private/qqmlobjectmodel_p.h>
+#if QT_CONFIG(qml_delegate_model)
#include <QtQml/private/qqmldelegatemodel_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -53,7 +55,9 @@ QQmlInstantiatorPrivate::QQmlInstantiatorPrivate()
, effectiveReset(false)
, active(true)
, async(false)
+#if QT_CONFIG(qml_delegate_model)
, ownModel(false)
+#endif
, requestedIndex(-1)
, model(QVariant(1))
, instanceModel(nullptr)
@@ -198,6 +202,7 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo
q->countChanged();
}
+#if QT_CONFIG(qml_delegate_model)
void QQmlInstantiatorPrivate::makeModel()
{
Q_Q(QQmlInstantiator);
@@ -209,6 +214,7 @@ void QQmlInstantiatorPrivate::makeModel()
if (componentComplete)
delegateModel->componentComplete();
}
+#endif
/*!
@@ -349,6 +355,7 @@ void QQmlInstantiator::setDelegate(QQmlComponent* c)
d->delegate = c;
emit delegateChanged();
+#if QT_CONFIG(qml_delegate_model)
if (!d->ownModel)
return;
@@ -356,6 +363,7 @@ void QQmlInstantiator::setDelegate(QQmlComponent* c)
dModel->setDelegate(c);
if (d->componentComplete)
d->regenerate();
+#endif
}
/*!
@@ -398,12 +406,15 @@ void QQmlInstantiator::setModel(const QVariant &v)
QObject *object = qvariant_cast<QObject*>(v);
QQmlInstanceModel *vim = nullptr;
if (object && (vim = qobject_cast<QQmlInstanceModel *>(object))) {
+#if QT_CONFIG(qml_delegate_model)
if (d->ownModel) {
delete d->instanceModel;
prevModel = nullptr;
d->ownModel = false;
}
+#endif
d->instanceModel = vim;
+#if QT_CONFIG(qml_delegate_model)
} else if (v != QVariant(0)){
if (!d->ownModel)
d->makeModel();
@@ -413,6 +424,7 @@ void QQmlInstantiator::setModel(const QVariant &v)
dataModel->setModel(v);
d->effectiveReset = false;
}
+#endif
}
if (d->instanceModel != prevModel) {
@@ -423,10 +435,12 @@ void QQmlInstantiator::setModel(const QVariant &v)
//disconnect(prevModel, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
}
- connect(d->instanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
- this, SLOT(_q_modelUpdated(QQmlChangeSet,bool)));
- connect(d->instanceModel, SIGNAL(createdItem(int,QObject*)), this, SLOT(_q_createdItem(int,QObject*)));
- //connect(d->instanceModel, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+ if (d->instanceModel) {
+ connect(d->instanceModel, SIGNAL(modelUpdated(QQmlChangeSet,bool)),
+ this, SLOT(_q_modelUpdated(QQmlChangeSet,bool)));
+ connect(d->instanceModel, SIGNAL(createdItem(int,QObject*)), this, SLOT(_q_createdItem(int,QObject*)));
+ //connect(d->instanceModel, SIGNAL(initItem(int,QObject*)), this, SLOT(initItem(int,QObject*)));
+ }
}
d->regenerate();
@@ -476,10 +490,13 @@ void QQmlInstantiator::componentComplete()
{
Q_D(QQmlInstantiator);
d->componentComplete = true;
+#if QT_CONFIG(qml_delegate_model)
if (d->ownModel) {
static_cast<QQmlDelegateModel*>(d->instanceModel)->componentComplete();
d->regenerate();
- } else {
+ } else
+#endif
+ {
QVariant realModel = d->model;
d->model = QVariant(0);
setModel(realModel); //If realModel == d->model this won't do anything, but that's fine since the model's 0
diff --git a/src/qml/types/qqmlinstantiator_p_p.h b/src/qml/types/qqmlinstantiator_p_p.h
index 9edaecf7a8..a5a4d1a32d 100644
--- a/src/qml/types/qqmlinstantiator_p_p.h
+++ b/src/qml/types/qqmlinstantiator_p_p.h
@@ -69,7 +69,9 @@ public:
void clear();
void regenerate();
+#if QT_CONFIG(qml_delegate_model)
void makeModel();
+#endif
void _q_createdItem(int, QObject *);
void _q_modelUpdated(const QQmlChangeSet &, bool);
QObject *modelObject(int index, bool async);
@@ -78,7 +80,9 @@ public:
bool effectiveReset:1;
bool active:1;
bool async:1;
+#if QT_CONFIG(qml_delegate_model)
bool ownModel:1;
+#endif
int requestedIndex;
QVariant model;
QQmlInstanceModel *instanceModel;
diff --git a/src/qml/types/qqmlmodelsmodule.cpp b/src/qml/types/qqmlmodelsmodule.cpp
index 872d7c059f..d9756704d1 100644
--- a/src/qml/types/qqmlmodelsmodule.cpp
+++ b/src/qml/types/qqmlmodelsmodule.cpp
@@ -42,7 +42,9 @@
#if QT_CONFIG(qml_list_model)
#include <private/qqmllistmodel_p.h>
#endif
+#if QT_CONFIG(qml_delegate_model)
#include <private/qqmldelegatemodel_p.h>
+#endif
#include <private/qqmlobjectmodel_p.h>
QT_BEGIN_NAMESPACE
@@ -55,9 +57,11 @@ void QQmlModelsModule::defineModule()
qmlRegisterType<QQmlListElement>(uri, 2, 1, "ListElement");
qmlRegisterCustomType<QQmlListModel>(uri, 2, 1, "ListModel", new QQmlListModelParser);
#endif
+#if QT_CONFIG(qml_delegate_model)
qmlRegisterType<QQmlDelegateModel>(uri, 2, 1, "DelegateModel");
qmlRegisterType<QQmlDelegateModel,12>(uri, 2, 9, "DelegateModel");
qmlRegisterType<QQmlDelegateModelGroup>(uri, 2, 1, "DelegateModelGroup");
+#endif
qmlRegisterType<QQmlObjectModel>(uri, 2, 1, "ObjectModel");
qmlRegisterType<QQmlObjectModel,3>(uri, 2, 3, "ObjectModel");
diff --git a/src/qml/types/types.pri b/src/qml/types/types.pri
index 25b231f954..5d75759281 100644
--- a/src/qml/types/types.pri
+++ b/src/qml/types/types.pri
@@ -1,7 +1,6 @@
SOURCES += \
$$PWD/qqmlbind.cpp \
$$PWD/qqmlconnections.cpp \
- $$PWD/qqmldelegatemodel.cpp \
$$PWD/qqmlmodelsmodule.cpp \
$$PWD/qqmlmodelindexvaluetype.cpp \
$$PWD/qqmlobjectmodel.cpp \
@@ -12,8 +11,6 @@ SOURCES += \
HEADERS += \
$$PWD/qqmlbind_p.h \
$$PWD/qqmlconnections_p.h \
- $$PWD/qqmldelegatemodel_p.h \
- $$PWD/qqmldelegatemodel_p_p.h \
$$PWD/qqmlmodelsmodule_p.h \
$$PWD/qqmlmodelindexvaluetype_p.h \
$$PWD/qqmlobjectmodel_p.h \
@@ -33,6 +30,15 @@ qtConfig(qml-list-model) {
$$PWD/qqmllistmodelworkeragent_p.h
}
+qtConfig(qml-delegate-model) {
+ SOURCES += \
+ $$PWD/qqmldelegatemodel.cpp
+
+ HEADERS += \
+ $$PWD/qqmldelegatemodel_p.h \
+ $$PWD/qqmldelegatemodel_p_p.h
+}
+
qtConfig(qml-animation) {
SOURCES += \
$$PWD/qqmltimer.cpp
diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index f0d3bcd186..d3b26a1ad5 100644
--- a/src/qml/util/qqmladaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -58,6 +58,8 @@
#include <private/qqmlguard_p.h>
#include <private/qqmlnullablevalue_p.h>
+QT_REQUIRE_CONFIG(qml_delegate_model);
+
QT_BEGIN_NAMESPACE
class QQmlEngine;
diff --git a/src/qml/util/util.pri b/src/qml/util/util.pri
index a9c5ffe9b7..bebb271f1b 100644
--- a/src/qml/util/util.pri
+++ b/src/qml/util/util.pri
@@ -2,12 +2,18 @@ SOURCES += \
$$PWD/qqmlchangeset.cpp \
$$PWD/qqmllistaccessor.cpp \
$$PWD/qqmllistcompositor.cpp \
- $$PWD/qqmladaptormodel.cpp \
$$PWD/qqmlpropertymap.cpp
HEADERS += \
$$PWD/qqmlchangeset_p.h \
$$PWD/qqmllistaccessor_p.h \
$$PWD/qqmllistcompositor_p.h \
- $$PWD/qqmladaptormodel_p.h \
$$PWD/qqmlpropertymap.h
+
+qtConfig(qml-delegate-model) {
+ SOURCES += \
+ $$PWD/qqmladaptormodel.cpp
+
+ HEADERS += \
+ $$PWD/qqmladaptormodel_p.h
+}
diff --git a/src/quick/configure.json b/src/quick/configure.json
index 7004ea7f7b..b77ea863b3 100644
--- a/src/quick/configure.json
+++ b/src/quick/configure.json
@@ -79,6 +79,7 @@
"label": "GridView item",
"purpose": "Provides the GridView item.",
"section": "Qt Quick",
+ "condition": "features.qml-delegate-model",
"output": [
"privateFeature"
]
@@ -101,6 +102,7 @@
"label": "ListView item",
"purpose": "Provides the ListView item.",
"section": "Qt Quick",
+ "condition": "features.qml-delegate-model",
"output": [
"privateFeature"
]
@@ -126,7 +128,10 @@
"label": "PathView item",
"purpose": "Provides the PathView item.",
"section": "Qt Quick",
- "condition": "features.quick-path",
+ "condition": [
+ "features.qml-delegate-model",
+ "features.quick-path"
+ ],
"output": [
"privateFeature"
]
@@ -143,6 +148,7 @@
"label": "Repeater item",
"purpose": "Provides the Repeater item.",
"section": "Qt Quick",
+ "condition": "features.qml-delegate-model",
"output": [
"privateFeature"
]
diff --git a/src/quick/designer/qquickdesignercustomobjectdata.cpp b/src/quick/designer/qquickdesignercustomobjectdata.cpp
index 59e086b5a3..daa9486f02 100644
--- a/src/quick/designer/qquickdesignercustomobjectdata.cpp
+++ b/src/quick/designer/qquickdesignercustomobjectdata.cpp
@@ -148,7 +148,19 @@ void QQuickDesignerCustomObjectData::populateResetHashes()
const QQuickDesignerSupport::PropertyNameList propertyNameList =
QQuickDesignerSupportProperties::propertyNameListForWritableProperties(object());
+ const QMetaObject *mo = object()->metaObject();
+ QStringList deferredPropertyNames;
+ const int namesIndex = mo->indexOfClassInfo("DeferredPropertyNames");
+ if (namesIndex != -1) {
+ QMetaClassInfo classInfo = mo->classInfo(namesIndex);
+ deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));
+ }
+
for (const QQuickDesignerSupport::PropertyName &propertyName : propertyNameList) {
+
+ if (deferredPropertyNames.contains(propertyName))
+ continue;
+
QQmlProperty property(object(), QString::fromUtf8(propertyName), QQmlEngine::contextForObject(object()));
QQmlAbstractBinding::Ptr binding = QQmlAbstractBinding::Ptr(QQmlPropertyPrivate::binding(property));
diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp
index 9fadbb2122..82474827aa 100644
--- a/src/quick/designer/qquickdesignersupportitems.cpp
+++ b/src/quick/designer/qquickdesignersupportitems.cpp
@@ -94,11 +94,24 @@ static void allSubObjects(QObject *object, QObjectList &objectList)
objectList.append(object);
+ const QMetaObject *mo = object->metaObject();
+
+ QStringList deferredPropertyNames;
+ const int namesIndex = mo->indexOfClassInfo("DeferredPropertyNames");
+ if (namesIndex != -1) {
+ QMetaClassInfo classInfo = mo->classInfo(namesIndex);
+ deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));
+ }
+
for (int index = QObject::staticMetaObject.propertyOffset();
index < object->metaObject()->propertyCount();
index++) {
+
QMetaProperty metaProperty = object->metaObject()->property(index);
+ if (deferredPropertyNames.contains(metaProperty.name()))
+ continue;
+
// search recursive in property objects
if (metaProperty.isReadable()
&& metaProperty.isWritable()
diff --git a/src/quick/designer/qquickdesignersupportproperties.cpp b/src/quick/designer/qquickdesignersupportproperties.cpp
index 674f811f8f..c746f55daa 100644
--- a/src/quick/designer/qquickdesignersupportproperties.cpp
+++ b/src/quick/designer/qquickdesignersupportproperties.cpp
@@ -202,11 +202,20 @@ QQuickDesignerSupport::PropertyNameList QQuickDesignerSupportProperties::allProp
const QMetaObject *metaObject = object->metaObject();
+
+ QStringList deferredPropertyNames;
+ const int namesIndex = metaObject->indexOfClassInfo("DeferredPropertyNames");
+ if (namesIndex != -1) {
+ QMetaClassInfo classInfo = metaObject->classInfo(namesIndex);
+ deferredPropertyNames = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));
+ }
+
for (int index = 0; index < metaObject->propertyCount(); ++index) {
QMetaProperty metaProperty = metaObject->property(index);
QQmlProperty declarativeProperty(object, QString::fromUtf8(metaProperty.name()));
if (declarativeProperty.isValid() && declarativeProperty.propertyTypeCategory() == QQmlProperty::Object) {
- if (declarativeProperty.name() != QLatin1String("parent")) {
+ if (declarativeProperty.name() != QLatin1String("parent")
+ && !deferredPropertyNames.contains(declarativeProperty.name())) {
QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());
if (childObject)
propertyNameList.append(allPropertyNames(childObject,