Gui: fix warning with Qt6

This commit is contained in:
wmayer
2023-04-05 20:34:45 +02:00
committed by wwmayer
parent 009b7c4886
commit 9455924dec

View File

@@ -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"