diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-02-02 23:52:50 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-26 10:57:25 +0000 |
commit | 960798f9117bc5aa4aa55bf868cbb0286f8e99b6 (patch) | |
tree | 16a8a27754a7cbed10feb74c19d152b156535ada /src/quicktemplates2/qquickbuttongroup_p.h | |
parent | fbcdccc4e2543555f89b9fa7236740471242df20 (diff) |
Add ButtonGroup::checkState
[ChangeLog][Controls][ButtonGroup] Added checkState property that
indicates the combined check state of the entire group.
Task-number: QTBUG-56295
Task-number: QTBUG-63782
Change-Id: I4c7efda2f29d5c20f9cd82642e488328f4ce91c8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickbuttongroup_p.h')
-rw-r--r-- | src/quicktemplates2/qquickbuttongroup_p.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickbuttongroup_p.h b/src/quicktemplates2/qquickbuttongroup_p.h index cd46d8f7..d2cbb8c2 100644 --- a/src/quicktemplates2/qquickbuttongroup_p.h +++ b/src/quicktemplates2/qquickbuttongroup_p.h @@ -51,6 +51,7 @@ #include <QtCore/qobject.h> #include <QtQuickTemplates2/private/qtquicktemplates2global_p.h> #include <QtQml/qqml.h> +#include <QtQml/qqmlparserstatus.h> QT_BEGIN_NAMESPACE @@ -59,12 +60,14 @@ class QQuickButtonGroupPrivate; class QQuickButtonGroupAttached; class QQuickButtonGroupAttachedPrivate; -class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickButtonGroup : public QObject +class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickButtonGroup : public QObject, public QQmlParserStatus { Q_OBJECT Q_PROPERTY(QQuickAbstractButton *checkedButton READ checkedButton WRITE setCheckedButton NOTIFY checkedButtonChanged FINAL) Q_PROPERTY(QQmlListProperty<QQuickAbstractButton> buttons READ buttons NOTIFY buttonsChanged FINAL) Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL REVISION 3) + Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState NOTIFY checkStateChanged FINAL REVISION 4) + Q_INTERFACES(QQmlParserStatus) public: explicit QQuickButtonGroup(QObject *parent = nullptr); @@ -80,6 +83,9 @@ public: bool isExclusive() const; void setExclusive(bool exclusive); + Qt::CheckState checkState() const; + void setCheckState(Qt::CheckState state); + public Q_SLOTS: void addButton(QQuickAbstractButton *button); void removeButton(QQuickAbstractButton *button); @@ -88,8 +94,13 @@ Q_SIGNALS: void checkedButtonChanged(); void buttonsChanged(); Q_REVISION(3) void exclusiveChanged(); + Q_REVISION(4) void checkStateChanged(); Q_REVISION(1) void clicked(QQuickAbstractButton *button); +protected: + void classBegin() override; + void componentComplete() override; + private: Q_DISABLE_COPY(QQuickButtonGroup) Q_DECLARE_PRIVATE(QQuickButtonGroup) |