aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcheckdelegate.cpp
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/qquickcheckdelegate.cpp
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/qquickcheckdelegate.cpp')
-rw-r--r--src/quicktemplates2/qquickcheckdelegate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickcheckdelegate.cpp b/src/quicktemplates2/qquickcheckdelegate.cpp
index 51bc8501..88ce25f3 100644
--- a/src/quicktemplates2/qquickcheckdelegate.cpp
+++ b/src/quicktemplates2/qquickcheckdelegate.cpp
@@ -170,9 +170,12 @@ QFont QQuickCheckDelegate::defaultFont() const
return QQuickControlPrivate::themeFont(QPlatformTheme::ListViewFont);
}
-void QQuickCheckDelegate::checkStateSet()
+void QQuickCheckDelegate::buttonChange(ButtonChange change)
{
- setCheckState(isChecked() ? Qt::Checked : Qt::Unchecked);
+ if (change == ButtonCheckedChange)
+ setCheckState(isChecked() ? Qt::Checked : Qt::Unchecked);
+ else
+ QQuickAbstractButton::buttonChange(change);
}
void QQuickCheckDelegate::nextCheckState()