KEditToolBar: show no-drop cursor with "Available" list for own items

Makes it more obvious to users that items in that list cannot be moved
around there, only dragged out.
This commit is contained in:
Friedrich W. H. Kossebau committed 2026-08-02 23:37:13 +00:00
1 parent f5780613d2
commit 304fca9f8b
2 files changed
+23

No files matched your search

+21
View File
@@ -18,6 +18,8 @@
#include <QDialogButtonBox>
#include <QDir>
#include <QDomDocument>
#include <QDragEnterEvent>
#include <QDragMoveEvent>
#include <QFile>
#include <QGridLayout>
#include <QLabel>
@@ -326,6 +328,25 @@ ToolBarItem *ToolBarListWidget::currentItem() const
return static_cast<ToolBarItem *>(QListWidget::currentItem());
}
void ToolBarListWidget::dragEnterEvent(QDragEnterEvent *event)
{
// no internal drag in inactive list
if (!m_activeList && (event->source() == this)) {
event->ignore();
return;
}
QListWidget::dragEnterEvent(event);
}
void ToolBarListWidget::dragMoveEvent(QDragMoveEvent *event)
{
// no internal drag in inactive list
if (!m_activeList && (event->source() == this)) {
event->ignore();
return;
}
QListWidget::dragMoveEvent(event);
}
IconTextEditDialog::IconTextEditDialog(QWidget *parent)
: QDialog(parent)
{
+2
View File
@@ -57,6 +57,8 @@ protected:
bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
// Skip internal dnd handling in QListWidget ---- how is one supposed to figure this out
// without reading the QListWidget code !?
void dropEvent(QDropEvent *ev) override