aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktestutils/quick/visualtestutils.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2025-04-17 10:34:11 +0800
committerShawn Rutledge <shawn.rutledge@qt.io>2025-04-23 08:46:45 +0200
commit2a424a02946bd99c265ff0610bb401816e819aec (patch)
tree5786b1a6dfe9a1d45c6ce0c53e8a882a03533b6f /src/quicktestutils/quick/visualtestutils.cpp
parent72dc34f213d58f4fab6a699f5d5244c233e89878 (diff)
Fix broken hover in ApplicationWindow's background
8fb643f6d63813a5a8df5e829e4ddeb357e0348d fixed ComboBox not being hoverable by setting QQuickApplicationWindowPrivate::control's hoverEnabled property to true. By doing so, it ensured that only that control and its parent chain could get hover events, breaking hover for e.g. background. The correct fix is to adapt QQuickControlPrivate::calcHoverEnabled to skip the property("hoverEnabled") == true check for QQuickApplicationWindowPrivate::control, resulting in it falling back to the global checks. - Remove code added in 8fb643f6d63813a5a8df5e829e4ddeb357e0348d. - Move QQuickApplicationWindowPrivate declaration into its own header so that code outside the .cpp file (qquickcontrol.cpp, in this case) can use it. - Document behavior of hover flags in void QQuickItem::setAcceptHoverEvents. - Move the check done in tst_QQuickControl::hoverEnabledDefault() into the new tst_QQuickApplicationWindow::hoverInBackground() since they're closely related. - Add initial starting position argument to PointLerper's constructor since it wasn't previously possible to set it. - Remove unused headers in qquickapplicationwindow.cpp. Fixes: QTBUG-133886 Fixes: QTBUG-136031 Pick-to: 6.9 Change-Id: Ic32f902be6433c1c9dc9f4610c5715ce1537e605 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quicktestutils/quick/visualtestutils.cpp')
-rw-r--r--src/quicktestutils/quick/visualtestutils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quicktestutils/quick/visualtestutils.cpp b/src/quicktestutils/quick/visualtestutils.cpp
index 9ce3a6df2a..e36accb220 100644
--- a/src/quicktestutils/quick/visualtestutils.cpp
+++ b/src/quicktestutils/quick/visualtestutils.cpp
@@ -85,9 +85,11 @@ QPoint QQuickVisualTestUtils::lerpPoints(const QPoint &point1, const QPoint &poi
QVERIFY(childButton->isHovered());
\endcode
*/
-QQuickVisualTestUtils::PointLerper::PointLerper(QQuickWindow *window, const QPointingDevice *pointingDevice)
+QQuickVisualTestUtils::PointLerper::PointLerper(QQuickWindow *window, const QPoint &startingPosition,
+ const QPointingDevice *pointingDevice)
: mWindow(window)
, mPointingDevice(pointingDevice)
+ , mFrom(startingPosition)
{
}