aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quicktemplates2/qquickactiongroup_p.h1
-rw-r--r--tests/auto/controls/data/tst_actiongroup.qml19
2 files changed, 20 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickactiongroup_p.h b/src/quicktemplates2/qquickactiongroup_p.h
index 42280831..aa04d32e 100644
--- a/src/quicktemplates2/qquickactiongroup_p.h
+++ b/src/quicktemplates2/qquickactiongroup_p.h
@@ -66,6 +66,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickActionGroup : public QObject
Q_PROPERTY(QQmlListProperty<QQuickAction> actions READ actions NOTIFY actionsChanged FINAL)
Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
+ Q_CLASSINFO("DefaultProperty", "actions")
public:
explicit QQuickActionGroup(QObject *parent = nullptr);
diff --git a/tests/auto/controls/data/tst_actiongroup.qml b/tests/auto/controls/data/tst_actiongroup.qml
index 6b31336d..700d247a 100644
--- a/tests/auto/controls/data/tst_actiongroup.qml
+++ b/tests/auto/controls/data/tst_actiongroup.qml
@@ -71,6 +71,15 @@ TestCase {
}
Component {
+ id: declarativeGroup
+ ActionGroup {
+ Action { text: "First" }
+ Action { text: "Second" }
+ Action { text: "Third" }
+ }
+ }
+
+ Component {
id: signalSpy
SignalSpy { }
}
@@ -208,6 +217,16 @@ TestCase {
compare(actionsSpy.count, 5)
}
+ function test_declarative() {
+ var group = createTemporaryObject(declarativeGroup, testCase)
+ verify(group)
+
+ compare(group.actions.length, 3)
+ compare(group.actions[0].text, "First")
+ compare(group.actions[1].text, "Second")
+ compare(group.actions[2].text, "Third")
+ }
+
function test_triggered_data() {
return [
{tag: "exclusive", exclusive: true},