Details
-
Suggestion
-
Resolution: Won't Do
-
P3: Somewhat important
-
4.4.0
-
None
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.