diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-09 16:03:15 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-09 14:45:01 +0000 |
commit | fdfb0e1d1cca04645bff07fbe7cc09f72f82b0da (patch) | |
tree | 608b0cffd5a5e3a6f631b69af28585a8226b8b10 | |
parent | 5f91556c684ef502352391c2eb8faec73b4c0726 (diff) |
QQuickActionGroup: add missing default property
Task-number: QTBUG-63674
Change-Id: I7e8eef4080f123ba5ad6b9ffa8bd8613c1b7b724
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quicktemplates2/qquickactiongroup_p.h | 1 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_actiongroup.qml | 19 |
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}, |