diff options
Diffstat (limited to 'src/qml/types/qqmldelegatemodel.cpp')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 2badef4268..7a34bab2f5 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -993,7 +993,9 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQ } } - cacheItem->incubateObject( + QQmlComponentPrivate *cp = QQmlComponentPrivate::get(m_delegate); + cp->incubateObject( + cacheItem->incubationTask, m_delegate, m_context->engine(), ctxt, @@ -1953,29 +1955,6 @@ void QQmlDelegateModelItem::Dispose() delete this; } -/* - This is essentially a copy of QQmlComponent::create(); except it takes the QQmlContextData - arguments instead of QQmlContext which means we don't have to construct the rather weighty - wrapper class for every delegate item. -*/ -void QQmlDelegateModelItem::incubateObject( - QQmlComponent *component, - QQmlEngine *engine, - QQmlContextData *context, - QQmlContextData *forContext) -{ - QQmlIncubatorPrivate *incubatorPriv = QQmlIncubatorPrivate::get(incubationTask); - QQmlEnginePrivate *enginePriv = QQmlEnginePrivate::get(engine); - QQmlComponentPrivate *componentPriv = QQmlComponentPrivate::get(component); - - incubatorPriv->compilationUnit = componentPriv->compilationUnit; - incubatorPriv->enginePriv = enginePriv; - incubatorPriv->creator.reset(new QQmlObjectCreator(context, componentPriv->compilationUnit, componentPriv->creationContext)); - incubatorPriv->subComponentToCreate = componentPriv->start; - - enginePriv->incubate(*incubationTask, forContext); -} - void QQmlDelegateModelItem::destroyObject() { Q_ASSERT(object); |