aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickabstractbutton_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2016-04-12 16:19:58 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-15 14:45:47 +0000
commiteae24fccc57437170e2ba01b894fa24fe65292be (patch)
treedfbd1450c237df8c2cd08838d2f054ef029ceea8 /src/quicktemplates2/qquickabstractbutton_p.h
parent0fe0283308199a6bf4a155627cddd524638c7063 (diff)
Add QQuickAbstractButton::down
This property will determine whether or not the button is visually pressed. Having such a distinction allows users more control over their controls. The patch also fixes the problem with ComboBox where pressing on the ComboBox when it's open would cause a delegate in the popup to show as being pressed. Unless explicitly set, this property follows the value of the pressed property. To return to the default value, set it to undefined. Change-Id: I29ecf325ed2ede125613f0c878b0427937599866 Task-number: QTBUG-51005 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton_p.h')
-rw-r--r--src/quicktemplates2/qquickabstractbutton_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h
index 49de79da..c8e6931f 100644
--- a/src/quicktemplates2/qquickabstractbutton_p.h
+++ b/src/quicktemplates2/qquickabstractbutton_p.h
@@ -58,7 +58,8 @@ class Q_QUICKTEMPLATES2_EXPORT QQuickAbstractButton : public QQuickControl
{
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
- Q_PROPERTY(bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL)
+ Q_PROPERTY(bool down READ isDown WRITE setDown NOTIFY downChanged RESET resetDown FINAL)
+ Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged FINAL)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL)
Q_PROPERTY(bool highlighted READ isHighlighted WRITE setHighlighted NOTIFY highlightedChanged FINAL)
Q_PROPERTY(bool autoExclusive READ autoExclusive WRITE setAutoExclusive NOTIFY autoExclusiveChanged FINAL)
@@ -72,6 +73,10 @@ public:
QString text() const;
void setText(const QString &text);
+ bool isDown() const;
+ void setDown(bool down);
+ void resetDown();
+
bool isPressed() const;
void setPressed(bool pressed);
@@ -104,6 +109,7 @@ Q_SIGNALS:
void pressAndHold();
void doubleClicked();
void textChanged();
+ void downChanged();
void pressedChanged();
void checkedChanged();
void highlightedChanged();