Commit 7c5069c2 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

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: default avatarMitch Curtis <mitch.curtis@digia.com>
parent ad900e17
......@@ -92,5 +92,48 @@ Section {
ExpandingSpacer {
}
}
Label {
visible: majorQtQuickVersion > 1
text: qsTr("Enabled")
}
SecondColumnLayout {
visible: majorQtQuickVersion > 1
CheckBox {
backendValue: backendValues.enabled
text: qsTr("Accept mouse and keyboard events")
}
ExpandingSpacer {
}
}
Label {
visible: majorQtQuickVersion > 1
text: qsTr("Smooth")
}
SecondColumnLayout {
visible: majorQtQuickVersion > 1
CheckBox {
backendValue: backendValues.smooth
text: qsTr("Smooth sampling active")
}
ExpandingSpacer {
}
}
Label {
visible: majorQtQuickVersion > 1
text: qsTr("Antialiasing")
}
SecondColumnLayout {
visible: majorQtQuickVersion > 1
CheckBox {
backendValue: backendValues.antialiasing
text: qsTr("Anti-aliasing active")
}
ExpandingSpacer {
}
}
}
}
......@@ -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;
......
......@@ -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;
};
......
......@@ -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";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment