diff options
authorMitch Curtis <>2018-04-24 18:26:23 +0200
committerSimon Hausmann <>2018-04-27 05:22:34 +0000
commit9d64da2fef62be237be964838ae9096f436ee7cd (patch)
parent3d80bbb6b47bc524f8243de26ff181026e8fc52d (diff)
QQmlDelegateModel: include QQDMIncubationTask errors with our errors
With the snippet in the referenced bug report (and the parent patch applied), the output is: qrc:/main.qml:19:19: QML ListView: Error creating delegate There should be more errors after this line, but since the delegate itself didn't have any errors, we need to also check with the incubation task. After doing so, the output becomes: qrc:/main.qml:19:19: QML ListView: Error creating delegate: qrc:/main.qml: Object destroyed during incubation This adds important context (for developers and for users reporting issues in the future) that was previously missing. Task-number: QTBUG-49224 Change-Id: Ic7ac1a06c7dbdf3746f960d28908cc10f6ae86f5 Reviewed-by: Simon Hausmann <>
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index c7351b654c..26c20d043f 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -877,6 +877,8 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
if (!isDoneIncubating(status))
+ const QList<QQmlError> incubationTaskErrors = incubationTask->errors();
QQmlDelegateModelItem *cacheItem = incubationTask->incubating;
cacheItem->incubationTask = nullptr;
incubationTask->incubating = nullptr;
@@ -890,7 +892,7 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
emitCreatedItem(incubationTask, cacheItem->object);
} else if (status == QQmlIncubator::Error) {
- qmlWarning(m_delegate, m_delegate->errors()) << "Error creating delegate";
+ qmlWarning(m_delegate, incubationTaskErrors + m_delegate->errors()) << "Error creating delegate";
if (!cacheItem->isObjectReferenced()) {