From c77d187b81dad91ba1d8fec35956a9822abe059e Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 2 Feb 2015 22:24:12 +0100 Subject: 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 --- src/quickwidgets/qquickwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quickwidgets/qquickwidget.cpp') diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index f5b2122b60..4dae6e6aef 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -826,6 +826,10 @@ void QQuickWidgetPrivate::setRootObject(QObject *obj) if (QQuickItem *sgItem = qobject_cast(obj)) { root = sgItem; sgItem->setParentItem(offscreenWindow->contentItem()); + } else if (qobject_cast(obj)) { + qWarning() << "QQuickWidget 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() << "QQuickWidget only supports loading of root objects that derive from QQuickItem." << endl << endl -- cgit v1.2.3