aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar.cpp
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/qquickscrollbar.cpp
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/qquickscrollbar.cpp')
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index b0d55dfb..be97f071 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -165,7 +165,6 @@ QQuickScrollBarPrivate::QQuickScrollBarPrivate()
moving(false),
interactive(true),
explicitInteractive(false),
- touchId(-1),
orientation(Qt::Vertical),
snapMode(QQuickScrollBar::NoSnap),
policy(QQuickScrollBar::AsNeeded)
@@ -269,7 +268,6 @@ void QQuickScrollBarPrivate::handleRelease(const QPointF &point)
pos = snapPosition(pos);
q->setPosition(pos);
offset = 0.0;
- touchId = -1;
q->setPressed(false);
}
@@ -277,7 +275,6 @@ void QQuickScrollBarPrivate::handleUngrab()
{
Q_Q(QQuickScrollBar);
offset = 0.0;
- touchId = -1;
q->setPressed(false);
}
@@ -657,9 +654,10 @@ void QQuickScrollBar::touchEvent(QTouchEvent *event)
break;
default:
- QQuickControl::touchEvent(event);
break;
}
+
+ QQuickControl::touchEvent(event);
}
void QQuickScrollBar::touchUngrabEvent()