1
// SPDX-License-Identifier: LGPL-2.1-or-later
3
/****************************************************************************
4
* Copyright (c) 2023 Boyer Pierre-louis <pierrelouis.boyer@gmail.com> *
5
* Copyright (c) 2023 FreeCAD Project Association *
7
* This file is part of FreeCAD. *
9
* FreeCAD is free software: you can redistribute it and/or modify it *
10
* under the terms of the GNU Lesser General Public License as *
11
* published by the Free Software Foundation, either version 2.1 of the *
12
* License, or (at your option) any later version. *
14
* FreeCAD is distributed in the hope that it will be useful, but *
15
* WITHOUT ANY WARRANTY; without even the implied warranty of *
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17
* Lesser General Public License for more details. *
19
* You should have received a copy of the GNU Lesser General Public *
20
* License along with FreeCAD. If not, see *
21
* <https://www.gnu.org/licenses/>. *
23
***************************************************************************/
25
#include "PreCompiled.h"
27
# include <QDragMoveEvent>
30
#include "ListWidgetDragBugFix.h"
33
ListWidgetDragBugFix::ListWidgetDragBugFix(QWidget * parent)
38
ListWidgetDragBugFix::~ListWidgetDragBugFix() = default;
40
void ListWidgetDragBugFix::dragMoveEvent(QDragMoveEvent *event)
42
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
43
QPoint pos = event->pos();
45
QPoint pos = event->position().toPoint();
47
if ((row(itemAt(pos)) == currentRow() + 1)
48
|| (currentRow() == count() - 1 && row(itemAt(pos)) == -1)) {
52
QListWidget::dragMoveEvent(event);
55
#include "moc_ListWidgetDragBugFix.cpp"