[frameworks/kio] autotests: kfilewidgettest: use the QPointF QDragEnterEvent ctor on Qt 6.12+

Méven Car <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 235d0d258b53e82d9f7a0217724637145ef6900a by Méven Car.
Committed on 25/07/2026 at 09:24.
Pushed by meven into branch 'master'.

kfilewidgettest: use the QPointF QDragEnterEvent ctor on Qt 6.12+

Qt 6.12 deprecated QDragEnterEvent's QPoint constructor in favour of one
taking QPointF. Guard on the Qt version so the test uses QPointF on 6.12
and later while still building against the required Qt 6.9.

M  +5    -1    autotests/kfilewidgettest.cpp

https://invent.kde.org/frameworks/kio/-/commit/235d0d258b53e82d9f7a0217724637145ef6900a

diff --git a/autotests/kfilewidgettest.cpp b/autotests/kfilewidgettest.cpp
index e3b8817d79..8e9b1258f7 100644
--- a/autotests/kfilewidgettest.cpp
+++ b/autotests/kfilewidgettest.cpp
@@ -595,11 +595,15 @@ void KFileWidgetTest::testDropFile()
     QAbstractItemView *view = fileWidget.dirOperator()->view();
     QVERIFY(view);
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 12, 0)
+    QDragEnterEvent event1(QPointF(), Qt::DropAction::MoveAction, mimeData.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier);
+#else
     QDragEnterEvent event1(QPoint(), Qt::DropAction::MoveAction, mimeData.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier);
+#endif
     QVERIFY(qApp->sendEvent(view->viewport(), &event1));
 
     // Fake drop
-    QDropEvent event(QPoint(), Qt::DropAction::MoveAction, mimeData.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier);
+    QDropEvent event(QPointF(), Qt::DropAction::MoveAction, mimeData.get(), Qt::MouseButton::LeftButton, Qt::KeyboardModifier::NoModifier);
     QVERIFY(qApp->sendEvent(view->viewport(), &event));
 
     // Verify the expected populated name. Dropping a file selects it through the
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.