Preferences: Workbench: Change the QListWidgetDragBug name to ListWidgetDragBug. Move the wbList setXxx() to ctor. Fix the 'Currently, your...'

This commit is contained in:
Paddle
2023-03-26 14:16:55 +02:00
parent 55d93ce3fb
commit a0f1b46f4e
5 changed files with 67 additions and 67 deletions

View File

@@ -0,0 +1,50 @@
/***************************************************************************
* Copyright (c) 2023 Boyer Pierre-louis <pierrelouis.boyer@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QDragMoveEvent>
#endif
#include "ListWidgetDragBugFix.h"
ListWidgetDragBugFix::ListWidgetDragBugFix(QWidget * parent)
: QListWidget(parent)
{
}
ListWidgetDragBugFix::~ListWidgetDragBugFix()
{
}
void ListWidgetDragBugFix::dragMoveEvent(QDragMoveEvent *e)
{
if ((row(itemAt(e->pos())) == currentRow() + 1)
|| (currentRow() == count() - 1 && row(itemAt(e->pos())) == -1)) {
e->ignore();
return;
}
QListWidget::dragMoveEvent(e);
}
#include "moc_ListWidgetDragBugFix.cpp"