diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-07-08 18:23:38 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2019-08-12 07:56:15 +0000 |
commit | d4e1f5395c896dc5bda9a2e122e2ed0f45be6c18 (patch) | |
tree | d482c42b86891fda16948d52d31f0e8ba0bd6b0b /src/quick/handlers | |
parent | d1b72c98b4e617530bfb23c3a5b7ebc68c15c089 (diff) |
Use QSH::mouseDoubleClickDistance() and touchDoubleTapDistance()
... in documentation links and in implementation, now that they have
been added. The doc links to QPlatformTheme::MouseDoubleClickDistance
and QPlatformTheme::TouchDoubleTapDistance were dead ends because
of those being private; and user code needed a way to read the values.
So now there is new API in QStyleHints.
Fixes: QTBUG-76944
Change-Id: I86bce4c7fe08c9da33745a4eed450757b3a30b03
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index 255e47d73a..a10064a665 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -78,8 +78,8 @@ int QQuickTapHandler::m_touchMultiTapDistanceSquared(-1); \l gesturePolicy to \c TapHandler.ReleaseWithinBounds. For multi-tap gestures (double-tap, triple-tap etc.), the distance moved - must not exceed QPlatformTheme::MouseDoubleClickDistance with mouse and - QPlatformTheme::TouchDoubleTapDistance with touch, and the time between + must not exceed QStyleHints::mouseDoubleClickDistance() with mouse and + QStyleHints::touchDoubleTapDistance() with touch, and the time between taps must not exceed QStyleHints::mouseDoubleClickInterval(). \sa MouseArea @@ -90,11 +90,9 @@ QQuickTapHandler::QQuickTapHandler(QQuickItem *parent) { if (m_mouseMultiClickDistanceSquared < 0) { m_multiTapInterval = qApp->styleHints()->mouseDoubleClickInterval() / 1000.0; - m_mouseMultiClickDistanceSquared = QGuiApplicationPrivate::platformTheme()-> - themeHint(QPlatformTheme::MouseDoubleClickDistance).toInt(); + m_mouseMultiClickDistanceSquared = qApp->styleHints()->mouseDoubleClickDistance(); m_mouseMultiClickDistanceSquared *= m_mouseMultiClickDistanceSquared; - m_touchMultiTapDistanceSquared = QGuiApplicationPrivate::platformTheme()-> - themeHint(QPlatformTheme::TouchDoubleTapDistance).toInt(); + m_touchMultiTapDistanceSquared = qApp->styleHints()->touchDoubleTapDistance(); m_touchMultiTapDistanceSquared *= m_touchMultiTapDistanceSquared; } } @@ -410,9 +408,9 @@ void QQuickTapHandler::updateTimeHeld() \since 5.11 This signal is emitted when the \c parent Item is tapped twice within a - short span of time (QStyleHints::mouseDoubleClickInterval) and distance - (QPlatformTheme::MouseDoubleClickDistance or - QPlatformTheme::TouchDoubleTapDistance). This signal always occurs after + short span of time (QStyleHints::mouseDoubleClickInterval()) and distance + (QStyleHints::mouseDoubleClickDistance() or + QStyleHints::touchDoubleTapDistance()). This signal always occurs after \l singleTapped, \l tapped, and \l tapCountChanged. The \c eventPoint signal parameter contains information from the release event about the point that was tapped. |