aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickabstractbutton_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-12-20 22:28:43 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2016-12-21 12:07:22 +0000
commitfed1476148399f4402ce2069874e7c66e834e764 (patch)
treebaac437da4423d7be890c01e7064de04b9bf1cf0 /src/quicktemplates2/qquickabstractbutton_p.h
parent7aee63b8a5db7721e079e1a3402a3ca6b4b1d06e (diff)
Add QQuickAbstractButton::buttonChange()
Merge the various virtuals to a single method that takes an enum value indicating the type of the change. This way we don't need to keep adding more and more virtuals, but can just extend the enum. The next in line is ButtonPressedChanged for the upcoming DelayButton. Change-Id: I40ebf170470790730217aba48c80daff8118dfba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton_p.h')
-rw-r--r--src/quicktemplates2/qquickabstractbutton_p.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h
index 00378bce..b8c9476f 100644
--- a/src/quicktemplates2/qquickabstractbutton_p.h
+++ b/src/quicktemplates2/qquickabstractbutton_p.h
@@ -126,12 +126,15 @@ protected:
void mouseUngrabEvent() override;
void timerEvent(QTimerEvent *event) override;
- virtual void checkStateSet();
- virtual void nextCheckState();
+ enum ButtonChange {
+ ButtonAutoRepeatChange,
+ ButtonCheckedChange,
+ ButtonCheckableChange,
+ ButtonTextChange
+ };
+ virtual void buttonChange(ButtonChange change);
- virtual void checkableChange();
- virtual void autoRepeatChange();
- virtual void textChange(const QString &newText, const QString &oldText);
+ virtual void nextCheckState();
#ifndef QT_NO_ACCESSIBILITY
void accessibilityActiveChanged(bool active) override;