mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 08:21:22 +00:00
The order is important, also is important to accept the event on the move event. While on the dock tree view we were always getting a forbidden cursor with no
possibility to drop, now we can nicely drop :) CCMAIL: peter.penz@gmx.at svn path=/trunk/KDE/kdebase/apps/; revision=750176
This commit is contained in:
parent
665ca266e9
commit
2446dd16e8
|
@ -106,10 +106,12 @@ void SidebarTreeView::startDrag(Qt::DropActions supportedActions)
|
||||||
|
|
||||||
void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event)
|
void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
|
QTreeView::dragEnterEvent(event);
|
||||||
|
|
||||||
if (event->mimeData()->hasUrls()) {
|
if (event->mimeData()->hasUrls()) {
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
}
|
||||||
QTreeView::dragEnterEvent(event);
|
|
||||||
m_dragging = true;
|
m_dragging = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +133,11 @@ void SidebarTreeView::dragMoveEvent(QDragMoveEvent* event)
|
||||||
setDirtyRegion(m_dropRect);
|
setDirtyRegion(m_dropRect);
|
||||||
m_dropRect = visualRect(index);
|
m_dropRect = visualRect(index);
|
||||||
setDirtyRegion(m_dropRect);
|
setDirtyRegion(m_dropRect);
|
||||||
|
|
||||||
|
if (event->mimeData()->hasUrls()) {
|
||||||
|
// accept url drops, independently from the destination item
|
||||||
|
event->acceptProposedAction();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SidebarTreeView::dropEvent(QDropEvent* event)
|
void SidebarTreeView::dropEvent(QDropEvent* event)
|
||||||
|
|
Loading…
Reference in a new issue