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

Mac: Suggestion to be able to specify drag behaviour for proxy icons in Qt4.4

    XMLWordPrintable

Details

    • macOS

    Description

      It would be nice if there was a way to specify the drag behaviour with the proxy icon in Qt 4.4.

      Previously, in Qt4.3, I had to write my own code within a
      reimplemented event() function to begin the proxy icon drag. When
      doing so it was possible to specify the action I wanted (copy).
      It does not seem possible to do this with the new setup of using the new setWindowFilePath(filename).

      Now all there is is one function,
      setWindowFilePath. for example, previously the code would look something like:

      QDrag *drag = new QDrag(this);
      QMimeData *data = new QMimeData();
      QPixmap cursorPixmap = currentDragProxyPixmap();
      QPoint hotspot(cursorPixmap.width() - 5, 5);

      data->setUrls ( QList<QUrl>() << QUrl::fromLocalFile(currFilename()) );
      drag->setMimeData( data );
      drag->setPixmap ( cursorPixmap );
      drag->setHotSpot ( hotspot );
      drag->start ( Qt::LinkAction | Qt::CopyAction );

      Notice the last line. With the new Qt4.4 method there is no such control
      and instead of Qt::CopyAction the file is being moved if dragging
      the proxy icon and drop it on the desktop.

      It would be nice if a copy be could be
      made, or an alias to the original file be made, not an actual move.
      Perhaps another function needs to be added to QWidget like
      setProxyDragAction.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            admin Administrator
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes