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:
Rafael Fernández López 2007-12-18 21:11:33 +00:00
parent 665ca266e9
commit 2446dd16e8

View file

@ -106,10 +106,12 @@ void SidebarTreeView::startDrag(Qt::DropActions supportedActions)
void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event)
{
QTreeView::dragEnterEvent(event);
if (event->mimeData()->hasUrls()) {
event->acceptProposedAction();
}
QTreeView::dragEnterEvent(event);
m_dragging = true;
}
@ -131,6 +133,11 @@ void SidebarTreeView::dragMoveEvent(QDragMoveEvent* event)
setDirtyRegion(m_dropRect);
m_dropRect = visualRect(index);
setDirtyRegion(m_dropRect);
if (event->mimeData()->hasUrls()) {
// accept url drops, independently from the destination item
event->acceptProposedAction();
}
}
void SidebarTreeView::dropEvent(QDropEvent* event)