aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2020-05-06 22:08:36 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2020-05-06 20:17:20 +0000
commit369b020b4b78479f7b82d53a7196372f1fb65711 (patch)
tree884f320cc0e07a4b33ed34f49360a17e538cca02 /src/plugins/qmldesigner
parent33c88a0ced1551e5845f67f1cf7f241e227c7d12 (diff)
QmlDesigner: Add allStatesForId
Change-Id: Ie04c58f50f2c9f5941afac2a3fba714ea9e61eb0 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp11
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp
index 8be49060e6..1a52a639a7 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp
@@ -426,6 +426,17 @@ QStringList PropertyEditorContextObject::styleNamesForFamily(const QString &fami
return dataBase.styles(family);
}
+QStringList PropertyEditorContextObject::allStatesForId(const QString &id)
+{
+ if (m_model && m_model->rewriterView()) {
+ const QmlObjectNode node = m_model->rewriterView()->modelNodeForId(id);
+ if (node.isValid())
+ return node.allStateNames();
+ }
+
+ return {};
+}
+
void EasingCurveEditor::registerDeclarativeType()
{
qmlRegisterType<EasingCurveEditor>("HelperWidgets", 2, 0, "EasingCurveEditor");
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h
index 9e3309ee35..03d82dbc34 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h
@@ -94,6 +94,8 @@ public:
Q_INVOKABLE QStringList styleNamesForFamily(const QString &family);
+ Q_INVOKABLE QStringList allStatesForId(const QString &id);
+
int majorVersion() const;
int majorQtQuickVersion() const;
int minorQtQuickVersion() const;