diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2015-02-02 22:24:12 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2015-02-23 12:43:08 +0000 |
commit | c77d187b81dad91ba1d8fec35956a9822abe059e (patch) | |
tree | a5da3786a78b4d15908f46ed23e90e249e058865 /src/quick/items/qquickview.cpp | |
parent | 59f6a78b5fddf71f2c98e8b67e093b7e8d1cb3d3 (diff) |
QQuickView/QQuickWidget: Improve diagnostics for using a QWindow as a base item in a scene.
The current message is rather confusing, as it was aimed at users porting from
QtQuick 1 -- but it is perfectly possible to get a non-QQuickItem root in a
QQuickView scene right now with QtQuick 2 only.
Change-Id: Ibd800f8a817c874af5eaa1746567ee289988fd01
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickview.cpp')
-rw-r--r-- | src/quick/items/qquickview.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp index a463f0a554..9bc512b80b 100644 --- a/src/quick/items/qquickview.cpp +++ b/src/quick/items/qquickview.cpp @@ -508,6 +508,10 @@ void QQuickViewPrivate::setRootObject(QObject *obj) if (QQuickItem *sgItem = qobject_cast<QQuickItem *>(obj)) { root = sgItem; sgItem->setParentItem(q->QQuickWindow::contentItem()); + } else if (qobject_cast<QWindow *>(obj)) { + qWarning() << "QQuickView does not support using windows as a root item." << endl + << endl + << "If you wish to create your root window from QML, consider using QQmlApplicationEngine instead." << endl; } else { qWarning() << "QQuickView only supports loading of root objects that derive from QQuickItem." << endl << endl |