diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-01-14 15:08:51 +0100 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-01-14 15:15:17 +0100 |
commit | 7c5069c2fd5132f7ea44a422dacc0a8afc1958dd (patch) | |
tree | e5829941dfce38415d381c6625776885bb02455c /src | |
parent | ad900e177a6f2e39806f426b0ebd84a760f59ca4 (diff) |
QmlDesigner.PropertyEditor: Ading missing QtQuick 2 only properties
Those properties are QtQuick 2 only and were missing in the
property editor.
Change-Id: Ie58a4eac86b945bdde24d32fc373396268bb593e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src')
3 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index fde3f3ef14..75cf14f7ef 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -40,6 +40,7 @@ PropertyEditorContextObject::PropertyEditorContextObject(QObject *parent) : m_backendValues(0), m_majorVersion(-1), m_minorVersion(-1), + m_majorQtQuickVersion(-1), m_qmlComponent(0), m_qmlContext(0) { @@ -52,6 +53,11 @@ int PropertyEditorContextObject::majorVersion() const } +int PropertyEditorContextObject::majorQtQuickVersion() const +{ + return m_majorQtQuickVersion; +} + void PropertyEditorContextObject::setMajorVersion(int majorVersion) { if (m_majorVersion == majorVersion) @@ -62,6 +68,17 @@ void PropertyEditorContextObject::setMajorVersion(int majorVersion) emit majorVersionChanged(); } +void PropertyEditorContextObject::setMajorQtQuickVersion(int majorVersion) +{ + if (m_majorQtQuickVersion == majorVersion) + return; + + m_majorQtQuickVersion = majorVersion; + + emit majorQtQuickVersionChanged(); + +} + int PropertyEditorContextObject::minorVersion() const { return m_minorVersion; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h index 0c5e4a5690..22ec4d44f9 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h @@ -53,6 +53,7 @@ class PropertyEditorContextObject : public QObject Q_PROPERTY(int majorVersion READ majorVersion WRITE setMajorVersion NOTIFY majorVersionChanged) Q_PROPERTY(int minorVersion READ minorVersion WRITE setMinorVersion NOTIFY minorVersionChanged) + Q_PROPERTY(int majorQtQuickVersion READ majorQtQuickVersion WRITE setMajorQtQuickVersion NOTIFY majorQtQuickVersionChanged) Q_PROPERTY(QQmlPropertyMap* backendValues READ backendValues WRITE setBackendValues NOTIFY backendValuesChanged) @@ -74,7 +75,9 @@ public: Q_INVOKABLE QString convertColorToString(const QColor &color) { return color.name(); } int majorVersion() const; + int majorQtQuickVersion() const; void setMajorVersion(int majorVersion); + void setMajorQtQuickVersion(int majorVersion); int minorVersion() const; void setMinorVersion(int minorVersion); @@ -91,6 +94,7 @@ signals: void backendValuesChanged(); void majorVersionChanged(); void minorVersionChanged(); + void majorQtQuickVersionChanged(); void specificQmlComponentChanged(); public slots: @@ -124,6 +128,7 @@ private: int m_majorVersion; int m_minorVersion; + int m_majorQtQuickVersion; QQmlComponent *m_qmlComponent; QQmlContext *m_qmlContext; }; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 25cdc1cd69..12f74c5218 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -290,8 +290,10 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q } else { contextObject()->setMajorVersion(-1); contextObject()->setMinorVersion(-1); + contextObject()->setMajorQtQuickVersion(-1); } + contextObject()->setMajorQtQuickVersion(qmlObjectNode.view()->majorQtQuickVersion()); } else { qWarning() << "PropertyEditor: invalid node for setup"; } |