From 9455924decf1f9c5d97802b66ea52743d04b0cc6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 5 Apr 2023 20:34:45 +0200 Subject: [PATCH] Gui: fix warning with Qt6 --- src/Gui/ListWidgetDragBugFix.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Gui/ListWidgetDragBugFix.cpp b/src/Gui/ListWidgetDragBugFix.cpp index d679f7b248..dfaaa01b74 100644 --- a/src/Gui/ListWidgetDragBugFix.cpp +++ b/src/Gui/ListWidgetDragBugFix.cpp @@ -39,14 +39,19 @@ ListWidgetDragBugFix::~ListWidgetDragBugFix() { } -void ListWidgetDragBugFix::dragMoveEvent(QDragMoveEvent *e) +void ListWidgetDragBugFix::dragMoveEvent(QDragMoveEvent *event) { - if ((row(itemAt(e->pos())) == currentRow() + 1) - || (currentRow() == count() - 1 && row(itemAt(e->pos())) == -1)) { - e->ignore(); +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + QPoint pos = event->pos(); +#else + QPoint pos = event->position().toPoint(); +#endif + if ((row(itemAt(pos)) == currentRow() + 1) + || (currentRow() == count() - 1 && row(itemAt(pos)) == -1)) { + event->ignore(); return; } - QListWidget::dragMoveEvent(e); + QListWidget::dragMoveEvent(event); } #include "moc_ListWidgetDragBugFix.cpp"