From 5b21f8529ebc8e3e66ec6d057734f90b10bb7657 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 10 Sep 2014 15:27:58 +0200 Subject: move QQuickWindowAttached to QQuickWindowQmlImpl It causes problems to do qmlRegisterType on QQuickWindow if the attached property also refers to QQuickWindow. Task-number: QTBUG-40816 Task-number: QTBUG-41047 Change-Id: I7a6f75af52f65e2be022b97128702982bec7cbe8 Reviewed-by: J-P Nurmi --- src/quick/items/qquickwindowmodule.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/quick/items/qquickwindowmodule.cpp') diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp index b0c99782f2..371abd163b 100644 --- a/src/quick/items/qquickwindowmodule.cpp +++ b/src/quick/items/qquickwindowmodule.cpp @@ -79,6 +79,11 @@ public: QQuickWindow::setVisibility(visibility); } + static QQuickWindowAttached *qmlAttachedProperties(QObject *object) + { + return new QQuickWindowAttached(object); + } + Q_SIGNALS: void visibleChanged(bool arg); void visibilityChanged(QWindow::Visibility visibility); @@ -166,16 +171,13 @@ void QQuickWindowModule::defineModule() { const char uri[] = "QtQuick.Window"; - // Since Window is both an attached property and a createable type, - // the attached property declaration must come first so that it can - // be overridden below. - qmlRegisterUncreatableType(uri, 2, 2, "Window", QQuickWindow::tr("Window is available via attached properties")); qmlRegisterType(uri, 2, 0, "Window"); qmlRegisterRevision(uri, 2, 1); qmlRegisterRevision(uri, 2, 2); qmlRegisterRevision(uri, 2, 1);//Type moved to a subclass, but also has new members qmlRegisterRevision(uri, 2, 2); qmlRegisterType(uri, 2, 1, "Window"); + qmlRegisterType(uri, 2, 2, "Window"); qmlRegisterUncreatableType(uri, 2, 0, "Screen", QStringLiteral("Screen can only be used via the attached property.")); } @@ -183,3 +185,4 @@ void QQuickWindowModule::defineModule() QT_END_NAMESPACE +QML_DECLARE_TYPEINFO(QQuickWindowQmlImpl, QML_HAS_ATTACHED_PROPERTIES) -- cgit v1.2.3