aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-01 21:38:16 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-07 09:56:45 +0000
commit038d5651940cfcd9fad017e6a4df00389b997da3 (patch)
tree302f8ff40155c31b00f9eaf1dcdb6188ae160f48 /src/quicktemplates2
parenta4a570e813c72e308dd0897bcf256d19fee471a3 (diff)
Let users disable the multi-touch support
The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/configure.json9
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp4
-rw-r--r--src/quicktemplates2/qquickcontrol_p.h2
-rw-r--r--src/quicktemplates2/qquickcontrol_p_p.h2
-rw-r--r--src/quicktemplates2/qquickdial.cpp2
-rw-r--r--src/quicktemplates2/qquickdial_p.h2
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp10
-rw-r--r--src/quicktemplates2/qquickdrawer_p.h2
-rw-r--r--src/quicktemplates2/qquickdrawer_p_p.h2
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp12
-rw-r--r--src/quicktemplates2/qquickoverlay_p.h2
-rw-r--r--src/quicktemplates2/qquickoverlay_p_p.h2
-rw-r--r--src/quicktemplates2/qquickpopup.cpp8
-rw-r--r--src/quicktemplates2/qquickpopup_p.h2
-rw-r--r--src/quicktemplates2/qquickpopup_p_p.h4
-rw-r--r--src/quicktemplates2/qquickpopupitem.cpp2
-rw-r--r--src/quicktemplates2/qquickpopupitem_p_p.h2
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp6
-rw-r--r--src/quicktemplates2/qquickrangeslider_p.h2
-rw-r--r--src/quicktemplates2/qquickslider.cpp2
-rw-r--r--src/quicktemplates2/qquickslider_p.h2
-rw-r--r--src/quicktemplates2/qquickswitch.cpp2
-rw-r--r--src/quicktemplates2/qquickswitch_p.h2
-rw-r--r--src/quicktemplates2/qquickswitchdelegate.cpp2
-rw-r--r--src/quicktemplates2/qquickswitchdelegate_p.h2
25 files changed, 88 insertions, 1 deletions
diff --git a/src/quicktemplates2/configure.json b/src/quicktemplates2/configure.json
index 45899e1f..030e668b 100644
--- a/src/quicktemplates2/configure.json
+++ b/src/quicktemplates2/configure.json
@@ -7,6 +7,12 @@
"purpose": "Provides support for hover effects.",
"section": "Quick Templates 2",
"output": [ "privateFeature" ]
+ },
+ "quicktemplates2-multitouch": {
+ "label": "Multi-touch support",
+ "purpose": "Provides support for multi-touch.",
+ "section": "Quick Templates 2",
+ "output": [ "privateFeature" ]
}
},
@@ -14,7 +20,8 @@
{
"section": "Qt Quick Templates 2",
"entries": [
- "quicktemplates2-hover"
+ "quicktemplates2-hover",
+ "quicktemplates2-multitouch"
]
}
]
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index a2b16a10..fb6c17f7 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -145,6 +145,7 @@ QQuickControlPrivate::~QQuickControlPrivate()
#endif
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickControlPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
{
if (point.id() == touchId)
@@ -157,6 +158,7 @@ bool QQuickControlPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
return false;
}
+#endif
void QQuickControlPrivate::handlePress(const QPointF &)
{
@@ -1366,6 +1368,7 @@ void QQuickControl::mouseUngrabEvent()
d->handleUngrab();
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickControl::touchEvent(QTouchEvent *event)
{
Q_D(QQuickControl);
@@ -1420,6 +1423,7 @@ void QQuickControl::touchUngrabEvent()
Q_D(QQuickControl);
d->handleUngrab();
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickControl::wheelEvent(QWheelEvent *event)
diff --git a/src/quicktemplates2/qquickcontrol_p.h b/src/quicktemplates2/qquickcontrol_p.h
index 6ad89376..8b52bd02 100644
--- a/src/quicktemplates2/qquickcontrol_p.h
+++ b/src/quicktemplates2/qquickcontrol_p.h
@@ -185,8 +185,10 @@ protected:
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseUngrabEvent() override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
void touchUngrabEvent() override;
+#endif
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h
index 42924875..73e1b44c 100644
--- a/src/quicktemplates2/qquickcontrol_p_p.h
+++ b/src/quicktemplates2/qquickcontrol_p_p.h
@@ -78,7 +78,9 @@ public:
return control->d_func();
}
+#if QT_CONFIG(quicktemplates2_multitouch)
virtual bool acceptTouch(const QTouchEvent::TouchPoint &point);
+#endif
virtual void handlePress(const QPointF &point);
virtual void handleMove(const QPointF &point);
virtual void handleRelease(const QPointF &point);
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp
index 7e740ade..bdbfb22d 100644
--- a/src/quicktemplates2/qquickdial.cpp
+++ b/src/quicktemplates2/qquickdial.cpp
@@ -666,6 +666,7 @@ void QQuickDial::mouseMoveEvent(QMouseEvent *event)
QQuickControl::mouseMoveEvent(event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickDial::touchEvent(QTouchEvent *event)
{
Q_D(QQuickDial);
@@ -702,6 +703,7 @@ void QQuickDial::touchEvent(QTouchEvent *event)
break;
}
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickDial::wheelEvent(QWheelEvent *event)
diff --git a/src/quicktemplates2/qquickdial_p.h b/src/quicktemplates2/qquickdial_p.h
index 1a6d70fd..959cb154 100644
--- a/src/quicktemplates2/qquickdial_p.h
+++ b/src/quicktemplates2/qquickdial_p.h
@@ -136,7 +136,9 @@ protected:
void keyReleaseEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 8159f05e..66c84ea2 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -278,6 +278,7 @@ bool QQuickDrawerPrivate::startDrag(QEvent *event)
}
break;
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
for (const QTouchEvent::TouchPoint &point : static_cast<QTouchEvent *>(event)->touchPoints()) {
@@ -288,6 +289,7 @@ bool QQuickDrawerPrivate::startDrag(QEvent *event)
}
}
break;
+#endif
default:
break;
@@ -340,6 +342,7 @@ bool QQuickDrawerPrivate::grabMouse(QQuickItem *item, QMouseEvent *event)
return overThreshold;
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
{
Q_Q(QQuickDrawer);
@@ -385,6 +388,7 @@ bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
return overThreshold;
}
+#endif
static const qreal openCloseVelocityThreshold = 300;
@@ -672,8 +676,10 @@ bool QQuickDrawer::childMouseEventFilter(QQuickItem *child, QEvent *event)
{
Q_D(QQuickDrawer);
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchUpdate:
return d->grabTouch(child, static_cast<QTouchEvent *>(event));
+#endif
case QEvent::MouseMove:
return d->grabMouse(child, static_cast<QMouseEvent *>(event));
case QEvent::MouseButtonPress:
@@ -695,8 +701,10 @@ bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
{
Q_D(QQuickDrawer);
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchUpdate:
return d->grabTouch(item, static_cast<QTouchEvent *>(event));
+#endif
case QEvent::MouseMove:
return d->grabMouse(item, static_cast<QMouseEvent *>(event));
default:
@@ -705,11 +713,13 @@ bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
return QQuickPopup::overlayEvent(item, event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickDrawer::touchEvent(QTouchEvent *event)
{
Q_D(QQuickDrawer);
d->grabTouch(d->popupItem, event);
}
+#endif
void QQuickDrawer::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
diff --git a/src/quicktemplates2/qquickdrawer_p.h b/src/quicktemplates2/qquickdrawer_p.h
index 9ab1c4ef..3ec007df 100644
--- a/src/quicktemplates2/qquickdrawer_p.h
+++ b/src/quicktemplates2/qquickdrawer_p.h
@@ -88,7 +88,9 @@ protected:
bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
bool overlayEvent(QQuickItem *item, QEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
diff --git a/src/quicktemplates2/qquickdrawer_p_p.h b/src/quicktemplates2/qquickdrawer_p_p.h
index bc4f91eb..8547bce5 100644
--- a/src/quicktemplates2/qquickdrawer_p_p.h
+++ b/src/quicktemplates2/qquickdrawer_p_p.h
@@ -74,7 +74,9 @@ public:
bool startDrag(QEvent *event);
bool grabMouse(QQuickItem *item, QMouseEvent *event);
+#if QT_CONFIG(quicktemplates2_multitouch)
bool grabTouch(QQuickItem *item, QTouchEvent *event);
+#endif
bool handlePress(QQuickItem* item, const QPointF &point, ulong timestamp) override;
bool handleMove(QQuickItem* item, const QPointF &point, ulong timestamp) override;
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index 15104808..a4aaa60d 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -276,6 +276,7 @@ bool QQuickOverlayPrivate::handleMouseEvent(QQuickItem *source, QMouseEvent *eve
return false;
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *event, QQuickPopup *target)
{
bool handled = false;
@@ -309,6 +310,7 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve
return handled;
}
+#endif
void QQuickOverlayPrivate::addPopup(QQuickPopup *popup)
{
@@ -475,11 +477,13 @@ void QQuickOverlay::mouseReleaseEvent(QMouseEvent *event)
d->handleMouseEvent(this, event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickOverlay::touchEvent(QTouchEvent *event)
{
Q_D(QQuickOverlay);
d->handleTouchEvent(this, event);
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickOverlay::wheelEvent(QWheelEvent *event)
@@ -516,10 +520,12 @@ bool QQuickOverlay::childMouseEventFilter(QQuickItem *item, QEvent *event)
// does not have background dimming.
if (item == p->dimmer || !p->popupItem->isAncestorOf(item)) {
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
return d->handleTouchEvent(item, static_cast<QTouchEvent *>(event), popup);
+#endif
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
@@ -541,6 +547,7 @@ bool QQuickOverlay::eventFilter(QObject *object, QEvent *event)
return false;
switch (event->type()) {
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -567,10 +574,13 @@ bool QQuickOverlay::eventFilter(QObject *object, QEvent *event)
// touch events, to be able to close non-modal popups on release outside.
event->accept();
return true;
+#endif
case QEvent::MouseButtonPress:
+#if QT_CONFIG(quicktemplates2_multitouch)
// do not emit pressed() twice when mouse events have been synthesized from touch events
if (static_cast<QMouseEvent *>(event)->source() == Qt::MouseEventNotSynthesized)
+#endif
emit pressed();
QQuickWindowPrivate::get(d->window)->handleMouseEvent(static_cast<QMouseEvent *>(event));
@@ -583,8 +593,10 @@ bool QQuickOverlay::eventFilter(QObject *object, QEvent *event)
return true;
case QEvent::MouseButtonRelease:
+#if QT_CONFIG(quicktemplates2_multitouch)
// do not emit released() twice when mouse events have been synthesized from touch events
if (static_cast<QMouseEvent *>(event)->source() == Qt::MouseEventNotSynthesized)
+#endif
emit released();
// allow non-modal popups to close on mouse release outside
diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h
index 7d1ff143..ba61c9c9 100644
--- a/src/quicktemplates2/qquickoverlay_p.h
+++ b/src/quicktemplates2/qquickoverlay_p.h
@@ -87,7 +87,9 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
diff --git a/src/quicktemplates2/qquickoverlay_p_p.h b/src/quicktemplates2/qquickoverlay_p_p.h
index 5553bda8..5008aa09 100644
--- a/src/quicktemplates2/qquickoverlay_p_p.h
+++ b/src/quicktemplates2/qquickoverlay_p_p.h
@@ -76,7 +76,9 @@ public:
bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target);
bool handleMouseEvent(QQuickItem *source, QMouseEvent *event, QQuickPopup *target = nullptr);
+#if QT_CONFIG(quicktemplates2_multitouch)
bool handleTouchEvent(QQuickItem *source, QTouchEvent *event, QQuickPopup *target = nullptr);
+#endif
void addPopup(QQuickPopup *popup);
void removePopup(QQuickPopup *popup);
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index e6d83350..a3db2484 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -299,6 +299,7 @@ bool QQuickPopupPrivate::contains(const QPointF &scenePos) const
return popupItem->contains(popupItem->mapFromScene(scenePos));
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
{
if (point.id() == touchId)
@@ -311,6 +312,7 @@ bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
return false;
}
+#endif
bool QQuickPopupPrivate::blockInput(QQuickItem *item, const QPointF &point) const
{
@@ -373,6 +375,7 @@ bool QQuickPopupPrivate::handleMouseEvent(QQuickItem *item, QMouseEvent *event)
}
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event)
{
switch (event->type()) {
@@ -418,6 +421,7 @@ bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event)
return false;
}
+#endif
bool QQuickPopupPrivate::prepareEnterTransition()
{
@@ -1987,10 +1991,12 @@ bool QQuickPopup::overlayEvent(QQuickItem *item, QEvent *event)
event->accept();
return d->modal;
+#if QT_CONFIG(quicktemplates2_multitouch)
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
return d->handleTouchEvent(item, static_cast<QTouchEvent *>(event));
+#endif
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
@@ -2001,6 +2007,7 @@ bool QQuickPopup::overlayEvent(QQuickItem *item, QEvent *event)
}
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickPopup::touchEvent(QTouchEvent *event)
{
Q_D(QQuickPopup);
@@ -2012,6 +2019,7 @@ void QQuickPopup::touchUngrabEvent()
Q_D(QQuickPopup);
d->handleUngrab();
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickPopup::wheelEvent(QWheelEvent *event)
diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h
index 12bbe91d..04179f08 100644
--- a/src/quicktemplates2/qquickpopup_p.h
+++ b/src/quicktemplates2/qquickpopup_p.h
@@ -351,8 +351,10 @@ protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseUngrabEvent();
virtual bool overlayEvent(QQuickItem *item, QEvent *event);
+#if QT_CONFIG(quicktemplates2_multitouch)
virtual void touchEvent(QTouchEvent *event);
virtual void touchUngrabEvent();
+#endif
#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *event);
#endif
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h
index 316ea5bd..ce64d49e 100644
--- a/src/quicktemplates2/qquickpopup_p_p.h
+++ b/src/quicktemplates2/qquickpopup_p_p.h
@@ -99,7 +99,9 @@ public:
bool contains(const QPointF &scenePos) const;
+#if QT_CONFIG(quicktemplates2_multitouch)
virtual bool acceptTouch(const QTouchEvent::TouchPoint &point);
+#endif
virtual bool blockInput(QQuickItem *item, const QPointF &point) const;
virtual bool handlePress(QQuickItem* item, const QPointF &point, ulong timestamp);
@@ -108,7 +110,9 @@ public:
virtual void handleUngrab();
bool handleMouseEvent(QQuickItem *item, QMouseEvent *event);
+#if QT_CONFIG(quicktemplates2_multitouch)
bool handleTouchEvent(QQuickItem *item, QTouchEvent *event);
+#endif
virtual void reposition();
virtual void resizeOverlay();
diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp
index 3a770bf7..6ccfd6ab 100644
--- a/src/quicktemplates2/qquickpopupitem.cpp
+++ b/src/quicktemplates2/qquickpopupitem.cpp
@@ -228,6 +228,7 @@ void QQuickPopupItem::mouseUngrabEvent()
d->popup->mouseUngrabEvent();
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickPopupItem::touchEvent(QTouchEvent *event)
{
Q_D(QQuickPopupItem);
@@ -239,6 +240,7 @@ void QQuickPopupItem::touchUngrabEvent()
Q_D(QQuickPopupItem);
d->popup->touchUngrabEvent();
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickPopupItem::wheelEvent(QWheelEvent *event)
diff --git a/src/quicktemplates2/qquickpopupitem_p_p.h b/src/quicktemplates2/qquickpopupitem_p_p.h
index 16321feb..d5447383 100644
--- a/src/quicktemplates2/qquickpopupitem_p_p.h
+++ b/src/quicktemplates2/qquickpopupitem_p_p.h
@@ -79,8 +79,10 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void mouseUngrabEvent() override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
void touchUngrabEvent() override;
+#endif
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index 3d767ed7..276e8d0c 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -328,7 +328,9 @@ public:
QQuickRangeSliderNode *pressedNode(int touchId = -1) const;
+#if QT_CONFIG(quicktemplates2_multitouch)
bool acceptTouch(const QTouchEvent::TouchPoint &point) override;
+#endif
void handlePress(const QPointF &point) override;
void handleMove(const QPointF &point) override;
void handleRelease(const QPointF &point) override;
@@ -397,6 +399,7 @@ QQuickRangeSliderNode *QQuickRangeSliderPrivate::pressedNode(int touchId) const
return nullptr;
}
+#if QT_CONFIG(quicktemplates2_multitouch)
bool QQuickRangeSliderPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
{
int firstId = QQuickRangeSliderNodePrivate::get(first)->touchId;
@@ -409,6 +412,7 @@ bool QQuickRangeSliderPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
return false;
}
+#endif
void QQuickRangeSliderPrivate::handlePress(const QPointF &point)
{
@@ -986,6 +990,7 @@ void QQuickRangeSlider::mouseMoveEvent(QMouseEvent *event)
QQuickControl::mouseMoveEvent(event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickRangeSlider::touchEvent(QTouchEvent *event)
{
Q_D(QQuickRangeSlider);
@@ -1023,6 +1028,7 @@ void QQuickRangeSlider::touchEvent(QTouchEvent *event)
break;
}
}
+#endif
void QQuickRangeSlider::mirrorChange()
{
diff --git a/src/quicktemplates2/qquickrangeslider_p.h b/src/quicktemplates2/qquickrangeslider_p.h
index c4bc52ff..439a0d45 100644
--- a/src/quicktemplates2/qquickrangeslider_p.h
+++ b/src/quicktemplates2/qquickrangeslider_p.h
@@ -117,7 +117,9 @@ protected:
void keyReleaseEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
void mirrorChange() override;
void componentComplete() override;
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 91607853..27b4a981 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -633,6 +633,7 @@ void QQuickSlider::mouseMoveEvent(QMouseEvent *event)
QQuickControl::mouseMoveEvent(event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickSlider::touchEvent(QTouchEvent *event)
{
Q_D(QQuickSlider);
@@ -670,6 +671,7 @@ void QQuickSlider::touchEvent(QTouchEvent *event)
break;
}
}
+#endif
#if QT_CONFIG(wheelevent)
void QQuickSlider::wheelEvent(QWheelEvent *event)
diff --git a/src/quicktemplates2/qquickslider_p.h b/src/quicktemplates2/qquickslider_p.h
index 6f0e6fc6..865902ab 100644
--- a/src/quicktemplates2/qquickslider_p.h
+++ b/src/quicktemplates2/qquickslider_p.h
@@ -134,7 +134,9 @@ protected:
void keyReleaseEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp
index ece9802d..f9bbff25 100644
--- a/src/quicktemplates2/qquickswitch.cpp
+++ b/src/quicktemplates2/qquickswitch.cpp
@@ -187,6 +187,7 @@ void QQuickSwitch::mouseMoveEvent(QMouseEvent *event)
QQuickAbstractButton::mouseMoveEvent(event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickSwitch::touchEvent(QTouchEvent *event)
{
Q_D(QQuickSwitch);
@@ -200,6 +201,7 @@ void QQuickSwitch::touchEvent(QTouchEvent *event)
}
QQuickAbstractButton::touchEvent(event);
}
+#endif
void QQuickSwitch::mirrorChange()
{
diff --git a/src/quicktemplates2/qquickswitch_p.h b/src/quicktemplates2/qquickswitch_p.h
index 5b93cd32..12e20bde 100644
--- a/src/quicktemplates2/qquickswitch_p.h
+++ b/src/quicktemplates2/qquickswitch_p.h
@@ -74,7 +74,9 @@ Q_SIGNALS:
protected:
void mouseMoveEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
void mirrorChange() override;
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp
index 9bce76db..d8ce8096 100644
--- a/src/quicktemplates2/qquickswitchdelegate.cpp
+++ b/src/quicktemplates2/qquickswitchdelegate.cpp
@@ -184,6 +184,7 @@ void QQuickSwitchDelegate::mouseMoveEvent(QMouseEvent *event)
QQuickItemDelegate::mouseMoveEvent(event);
}
+#if QT_CONFIG(quicktemplates2_multitouch)
void QQuickSwitchDelegate::touchEvent(QTouchEvent *event)
{
Q_D(QQuickSwitchDelegate);
@@ -197,6 +198,7 @@ void QQuickSwitchDelegate::touchEvent(QTouchEvent *event)
}
QQuickItemDelegate::touchEvent(event);
}
+#endif
QFont QQuickSwitchDelegate::defaultFont() const
{
diff --git a/src/quicktemplates2/qquickswitchdelegate_p.h b/src/quicktemplates2/qquickswitchdelegate_p.h
index e3e0804a..973ec21d 100644
--- a/src/quicktemplates2/qquickswitchdelegate_p.h
+++ b/src/quicktemplates2/qquickswitchdelegate_p.h
@@ -74,7 +74,9 @@ Q_SIGNALS:
protected:
void mouseMoveEvent(QMouseEvent *event) override;
+#if QT_CONFIG(quicktemplates2_multitouch)
void touchEvent(QTouchEvent *event) override;
+#endif
QFont defaultFont() const override;
void mirrorChange() override;