diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-04-24 18:10:41 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-04-27 05:22:04 +0000 |
commit | 8e20747e94fb24baf9eabbd034efe5c2cf810d55 (patch) | |
tree | 61003f938cc367efa905c63f4935d4b1a3ed037c /src/qml | |
parent | 2f397aa15a13efbadf6c1bc378bb134ac1e655c5 (diff) |
QQmlDelegateModel: provide better warnings
Currently, QQmlDelegateModel errors look like this:
<Unknown File>: QML VisualDataModel: Error creating delegate
This patch uses the delegate as the QQmlInfo object so that we get
errors with actual file names and line numbers:
qrc:/main.qml:19:19: QML Component: Error creating delegate
This has several benefits:
- It's obvious which file is causing the issue
- A clickable link in Creator's application output pane
Task-number: QTBUG-49224
Change-Id: I0df0d1a9e898aff5f83131ca62a47cc7f1c74c6e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/types/qqmldelegatemodel.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 44166e4aa8..c7351b654c 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -874,7 +874,6 @@ void QQmlDelegateModelPrivate::removeCacheItem(QQmlDelegateModelItem *cacheItem) void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status) { - Q_Q(QQmlDelegateModel); if (!isDoneIncubating(status)) return; @@ -891,7 +890,7 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba emitCreatedItem(incubationTask, cacheItem->object); cacheItem->releaseObject(); } else if (status == QQmlIncubator::Error) { - qmlWarning(q, m_delegate->errors()) << "Error creating delegate"; + qmlWarning(m_delegate, m_delegate->errors()) << "Error creating delegate"; } if (!cacheItem->isObjectReferenced()) { |