aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcontrol_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-04-19 14:02:32 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-04-20 06:12:39 +0000
commit211014bfcac08ae763f8b8c8497425c48eac6a77 (patch)
tree18ec60874ed73363e52ef85c1da8c28db2b6bbd0 /src/quicktemplates2/qquickcontrol_p_p.h
parentce4961b063fa3bfae1996e23014d8f6b5a69f994 (diff)
QQuickControl: implement focus handling on touch
QQuickControl::focusPolicy was only managed in mousePressEvent() and mouseReleaseEvent(). All controls call the base class implementations of these event handlers to get the focus policy handling "for free". Move focus policy handling to handlePress() and handleRelease() that can be re-used for touch events, and make sure that various controls call the base class implementation of touch event handlers. There's still a bit of duplication in QQuickControl::touchEvent() and the overridden handlers in sub-classes, but this will be improved step by step. QQuickControlPrivate::handlePress/Move/Release/Ungrab() are planned to be made virtual, overridden in subclasses, and only called from QQuickControl event handlers. Most mouse and touch event handlers in QQuickControl subclasses can be removed later when we get there. Task-number: QTBUG-58389 Change-Id: I7e82dc2ef49762a005c482ce1353e03cc841659f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcontrol_p_p.h')
-rw-r--r--src/quicktemplates2/qquickcontrol_p_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h
index 14a468f3..2c79c887 100644
--- a/src/quicktemplates2/qquickcontrol_p_p.h
+++ b/src/quicktemplates2/qquickcontrol_p_p.h
@@ -78,6 +78,11 @@ public:
return control->d_func();
}
+ void handlePress(const QPointF &point);
+ void handleMove(const QPointF &point);
+ void handleRelease(const QPointF &point);
+ void handleUngrab();
+
void mirrorChange() override;
void setTopPadding(qreal value, bool reset = false);
@@ -136,6 +141,7 @@ public:
bool hovered;
bool explicitHoverEnabled;
#endif
+ int touchId;
qreal padding;
qreal topPadding;
qreal leftPadding;