Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.2, 5.12.7
-
macOS Catalina, macOS High Sierra
Description
When dragging from a QWidget supporting both Qt::CopyAction and Qt::MoveAction, the source widget always receives Qt::MoveAction regardless of what the drop target widget specifies in dropEvent().
Eg: In the drop target widget:
void widget::dropEvent(QDropEvent *event)
{
event->setDropAction(Qt::CopyAction);
event->accept();
}
The overridden drop action is never propagated back to the widget which initiated the drag.
This results in the drag source removing the item instead of copying it.
It is particularly obvious when dragging from QAbstractItemView widgets, as they will automatically remove the dragged item.
It appears that in qnsview_dragging.mm, (BOOL)performDragOperation:(id <NSDraggingInfo>)sender is discarding the accepted_action returned from the QWindowSystemInterface::handleDrop() calls
Attachments
Issue Links
- duplicates
-
QTBUG-77427 setDropAction() is not respected in ItemViews during move operation on MAC
- Closed