diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-03-23 11:26:30 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-03-24 13:27:43 +0000 |
commit | 762d4ceb5fe19d97bcdbdba1dae74816126b7b75 (patch) | |
tree | f7c278b9944ddc57222d1573bcfc06de3328400f /src/quicktemplates2/qquickstackview_p.cpp | |
parent | 9ccdc189c7e39b8d4f645f082daa3a5e3fedc5b7 (diff) |
Add QQuickStackViewPrivate::warn() helper
Store the current operation name internally to allow throwing
informative warnings when component creation fails.
Task-number: QTBUG-59634
Change-Id: I7506c5eb4be35878c8abd73a637357e0d8ae08a2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickstackview_p.cpp')
-rw-r--r-- | src/quicktemplates2/qquickstackview_p.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickstackview_p.cpp b/src/quicktemplates2/qquickstackview_p.cpp index 89b3c6e3..077c13e3 100644 --- a/src/quicktemplates2/qquickstackview_p.cpp +++ b/src/quicktemplates2/qquickstackview_p.cpp @@ -38,6 +38,7 @@ #include "qquickstackelement_p_p.h" #include "qquickstacktransition_p_p.h" +#include <QtQml/qqmlinfo.h> #include <QtQml/qqmllist.h> #include <QtQml/private/qv4qmlcontext_p.h> #include <QtQml/private/qv4qobjectwrapper_p.h> @@ -53,6 +54,15 @@ QQuickStackViewPrivate::QQuickStackViewPrivate() { } +void QQuickStackViewPrivate::warn(const QString &error) +{ + Q_Q(QQuickStackView); + if (operation.isEmpty()) + qmlWarning(q) << error; + else + qmlWarning(q) << operation << ": " << error; +} + void QQuickStackViewPrivate::setCurrentItem(QQuickStackElement *element) { Q_Q(QQuickStackView); |