aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswitch_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-19 15:43:36 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-19 16:37:07 +0000
commit6ed4918f131ff235bcab3efe849f5b67406ef350 (patch)
treed541a058763935002e8d523a3938bac852c9fd75 /src/quicktemplates2/qquickswitch_p.h
parente5079c1828dd0fe2e90347f20da40da033fbec5a (diff)
QQuickSwitch: fix event handling
Switch implemented custom event handling for the indicator, and used QQuickAbstractButton's event handling for the background. This lead to inconsistent signals depending on whether interacting with the handle or the background. This change gets rid of the child mouse event filter for the indicator and makes QQuickSwitch fully utilize the base class event handlers. Change-Id: I773e2eb939cbbf4bc9086cdf2b34e876597ea08e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickswitch_p.h')
-rw-r--r--src/quicktemplates2/qquickswitch_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickswitch_p.h b/src/quicktemplates2/qquickswitch_p.h
index bfbcceed..27a065b4 100644
--- a/src/quicktemplates2/qquickswitch_p.h
+++ b/src/quicktemplates2/qquickswitch_p.h
@@ -73,9 +73,13 @@ Q_SIGNALS:
void visualPositionChanged();
protected:
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+
void mirrorChange() override;
- bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
+ void nextCheckState() override;
void checkStateSet() override;
private: