aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2024-03-14 23:29:38 -0700
committerShawn Rutledge <shawn.rutledge@qt.io>2024-03-15 13:03:00 -0700
commit691248f9172fde05110eb015e92823a525af754d (patch)
treeb0483de94754a1577c5a03b4100ba52ed61693fc /src/quick
parent057ef0fe567193679e2e71995f412ff93236ee3f (diff)
Use QPlatformTheme::themeHint not QPlatformIntegration::styleHint
Default values for such things as Flickable.flickDeceleration and maximumFlickVelocity, and the internal use of FlickStartDistance, are meant to be customizable in a QPlatformTheme subclass, for example KdePlatformTheme. QPlatformIntegration::styleHint() calls defaultThemeHint(), not the virtual themeHint(). Tellingly, there are no other calls to QPlatformIntegration::styleHint() in qtdeclarative. Amends 84d69e4695c179e595d24928a6480852d7f5186f Task-number: QTBUG-35608 Task-number: QTBUG-35609 Fixes: QTBUG-121500 Pick-to: 6.7 6.6 Change-Id: Idc17ee424755db1c7ba431f06fa5ef6515516c88 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickflickable.cpp8
-rw-r--r--src/quick/items/qquickpathview.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 84b413356f..f77ac092a0 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -22,7 +22,7 @@
#include <QtGui/private/qeventpoint_p.h>
#include <QtGui/qstylehints.h>
#include <QtCore/qmath.h>
-#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformtheme.h>
#include <math.h>
#include <cmath>
@@ -234,9 +234,9 @@ QQuickFlickablePrivate::QQuickFlickablePrivate()
, syncDrag(false)
, lastPosTime(-1)
, lastPressTime(0)
- , deceleration(QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FlickDeceleration).toReal())
+ , deceleration(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::FlickDeceleration).toReal())
, wheelDeceleration(15000)
- , maxVelocity(QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FlickMaximumVelocity).toReal())
+ , maxVelocity(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::FlickMaximumVelocity).toReal())
, delayedPressEvent(nullptr), pressDelay(0), fixupDuration(400)
, flickBoost(1.0), initialWheelFlickDistance(qApp->styleHints()->wheelScrollLines() * 24)
, fixupMode(Normal), vTime(0), visibleArea(nullptr)
@@ -1441,7 +1441,7 @@ void QQuickFlickablePrivate::handleReleaseEvent(QPointerEvent *event)
}
flickBoost = canBoost ? qBound(1.0, flickBoost+0.25, QML_FLICK_MULTIFLICK_MAXBOOST) : 1.0;
- const int flickThreshold = QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FlickStartDistance).toInt();
+ const int flickThreshold = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::FlickStartDistance).toInt();
bool flickedVertically = false;
vVelocity *= flickBoost;
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 598e2b08cf..5377622037 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -10,7 +10,7 @@
#include <private/qqmlglobal_p.h>
#include <private/qqmlopenmetaobject_p.h>
#include <private/qqmlchangeset_p.h>
-#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformtheme.h>
#include <QtQml/qqmlinfo.h>
@@ -65,7 +65,7 @@ QQuickPathViewPrivate::QQuickPathViewPrivate()
, moving(false), flicking(false), dragging(false), inRequest(false), delegateValidated(false)
, inRefill(false)
, dragMargin(0), deceleration(100)
- , maximumFlickVelocity(QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::FlickMaximumVelocity).toReal())
+ , maximumFlickVelocity(QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::FlickMaximumVelocity).toReal())
, moveOffset(this, &QQuickPathViewPrivate::setAdjustedOffset), flickDuration(0)
, pathItems(-1), requestedIndex(-1), cacheSize(0), requestedZ(0)
, moveReason(Other), movementDirection(QQuickPathView::Shortest), moveDirection(QQuickPathView::Shortest)