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
parent
60d99b6413
commit
91aa782f01
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue