(#467) Handling drag move events to get the proposed drop action

The tree view model's drag & drop handle is notified about the proposed
action in drag move events.
This commit is contained in:
Pål Hagen
2015-10-22 14:42:05 +02:00
parent 52f1e47576
commit 1b83bfb7f0
4 changed files with 28 additions and 0 deletions

View File

@@ -87,6 +87,16 @@ public:
virtual ~PdmUiTreeViewWidget() {};
protected:
virtual void dragMoveEvent(QDragMoveEvent* event)
{
caf::PdmUiTreeViewModel* treeViewModel = dynamic_cast<caf::PdmUiTreeViewModel*>(model());
if (treeViewModel)
{
treeViewModel->updateDragDropHandleFromEvent(event);
}
QTreeView::dragMoveEvent(event);
}
virtual void dragLeaveEvent(QDragLeaveEvent* event)
{
caf::PdmUiTreeViewModel* treeViewModel = dynamic_cast<caf::PdmUiTreeViewModel*>(model());
@@ -94,6 +104,8 @@ protected:
{
treeViewModel->endDrag();
}
QTreeView::dragLeaveEvent(event);
}
};