Core: Tree: Remove !vp->canDragAndDropObject(obj) that made no sense. And remove the auto switching to 'CopyAction'
This commit is contained in:
committed by
Chris Hennes
parent
36b9b58eb3
commit
4e4201f033
@@ -2010,7 +2010,7 @@ void TreeWidget::dragMoveEvent(QDragMoveEvent* event)
|
||||
try {
|
||||
if (da != Qt::LinkAction && !vp->canDropObjects()) {
|
||||
if (!(event->possibleActions() & Qt::LinkAction) || items.size() != 1) {
|
||||
TREE_TRACE("cannot drop");
|
||||
TREE_TRACE("Cannot drop here");
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
@@ -2025,17 +2025,14 @@ void TreeWidget::dragMoveEvent(QDragMoveEvent* event)
|
||||
|
||||
auto obj = item->object()->getObject();
|
||||
|
||||
if (da == Qt::MoveAction && !vp->canDragAndDropObject(obj)) {
|
||||
// Check if item can be dragged
|
||||
if (da == Qt::MoveAction) {
|
||||
// Check if item can be dragged from his parent
|
||||
auto parentItem = item->getParentItem();
|
||||
if (parentItem && !(parentItem->object()->canDragObjects() && parentItem->object()->canDragObject(item->object()->getObject())))
|
||||
{
|
||||
if (!(event->possibleActions() & Qt::CopyAction)) {
|
||||
TREE_TRACE("Cannot drag object");
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
event->setDropAction(Qt::CopyAction);
|
||||
TREE_TRACE("Cannot drag object");
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user