From 00eccf6b22baf39d4bec1ab08a5287c369d552f6 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 8 Aug 2013 19:27:18 +0200 Subject: [PATCH] QmlDesigner.PropertyEditorView: moving QML types registration Moving the registration of QML types from PropertyEditorView to QuickPropertyEditorView. The view itself should not handle QML implementation details anymore. Change-Id: Ia66db999e2f7a4b8cbe1111c4176257344d78ea8 Reviewed-by: Marco Bubke --- .../propertyeditor/propertyeditorview.cpp | 27 +--------------- .../quickpropertyeditorview.cpp | 31 +++++++++++++++++++ .../propertyeditor/quickpropertyeditorview.h | 2 ++ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 55de81ecad7..c0efd96cf0e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -43,17 +43,7 @@ #include #include "propertyeditorvalue.h" -#include "basiclayouts.h" -#include "basicwidgets.h" -#include "resetwidget.h" -#include "qlayoutobject.h" -#include -#include "gradientlineqmladaptor.h" -#include "behaviordialog.h" -#include "fontwidget.h" -#include "siblingcombobox.h" #include "propertyeditortransaction.h" -#include "originwidget.h" #include @@ -96,22 +86,7 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) : m_stackedWidget->insertWidget(0, new QWidget(m_stackedWidget)); - - static bool declarativeTypesRegistered = false; - if (!declarativeTypesRegistered) { - declarativeTypesRegistered = true; - BasicWidgets::registerDeclarativeTypes(); - BasicLayouts::registerDeclarativeTypes(); - ResetWidget::registerDeclarativeType(); - QLayoutObject::registerDeclarativeType(); - QmlEditorWidgets::ColorWidgets::registerDeclarativeTypes(); - BehaviorDialog::registerDeclarativeType(); - PropertyEditorValue::registerDeclarativeTypes(); - FontWidget::registerDeclarativeTypes(); - SiblingComboBox::registerDeclarativeTypes(); - OriginWidget::registerDeclarativeType(); - GradientLineQmlAdaptor::registerDeclarativeType(); - } + QuickPropertyEditorView::registerQmlTypes(); setQmlDir(PropertyEditorQmlBackend::propertyEditorResourcesPath()); m_stackedWidget->setWindowTitle(tr("Properties")); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.cpp index dcabb43f76a..d4ac338eb49 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.cpp @@ -29,6 +29,17 @@ #include "quickpropertyeditorview.h" +#include "basiclayouts.h" +#include "basicwidgets.h" +#include "resetwidget.h" +#include "qlayoutobject.h" +#include +#include "gradientlineqmladaptor.h" +#include "behaviordialog.h" +#include "fontwidget.h" +#include "siblingcombobox.h" +#include "originwidget.h" + #include #include #include @@ -141,4 +152,24 @@ void QuickPropertyEditorView::setRootWidget(QWidget *widget) } } +void QuickPropertyEditorView::registerQmlTypes() +{ + + static bool declarativeTypesRegistered = false; + if (!declarativeTypesRegistered) { + declarativeTypesRegistered = true; + BasicWidgets::registerDeclarativeTypes(); + BasicLayouts::registerDeclarativeTypes(); + ResetWidget::registerDeclarativeType(); + QLayoutObject::registerDeclarativeType(); + QmlEditorWidgets::ColorWidgets::registerDeclarativeTypes(); + BehaviorDialog::registerDeclarativeType(); + PropertyEditorValue::registerDeclarativeTypes(); + FontWidget::registerDeclarativeTypes(); + SiblingComboBox::registerDeclarativeTypes(); + OriginWidget::registerDeclarativeType(); + GradientLineQmlAdaptor::registerDeclarativeType(); + } +} + } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.h index 56fa25b1e58..b1a8839342d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/quickpropertyeditorview.h @@ -62,6 +62,8 @@ public: enum Status { Null, Ready, Loading, Error }; Status status() const; + static void registerQmlTypes(); + signals: void statusChanged(QuickPropertyEditorView::Status);