QDrag: Allow setting cursor for IgnoreAction

This is especially useful on macOS where the default
ignore cursor is the pointer cursor.

Change-Id: I5e14814abd2d59a7f4c4cd1029829ebbed5b3017
Task-number: QTBUG-26724
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
bb10
Morten Johan Sørvig 2017-05-12 15:02:12 +02:00
parent 60d99b6413
commit 91aa782f01
1 changed files with 3 additions and 4 deletions

View File

@ -319,14 +319,13 @@ Qt::DropAction QDrag::start(Qt::DropActions request)
to override the default native cursors. To revert to using the
native cursor for \a action pass in a null QPixmap as \a cursor.
The \a action can only be CopyAction, MoveAction or LinkAction.
All other values of DropAction are ignored.
Note: setting the drag cursor for IgnoreAction may not work on
all platforms. X11 and macOS has been tested to work. Windows
does not support it.
*/
void QDrag::setDragCursor(const QPixmap &cursor, Qt::DropAction action)
{
Q_D(QDrag);
if (action != Qt::CopyAction && action != Qt::MoveAction && action != Qt::LinkAction)
return;
if (cursor.isNull())
d->customCursors.remove(action);
else