Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81962

QDropEvent::setDropAction(Qt::DropAction) is ignored on macOS

    XMLWordPrintable

    Details

    • Platform/s:
      macOS

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              vhilshei Volker Hilsheimer
              Reporter:
              rthompson Richard Thompson
              PM Owner:
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes