QDrag: mark QDrag::start() as deprecated

QDrag::start() is deprecated since Qt4. Therefore annotate it with
Q_DEPRECATED so it can be removed in Qt6.

Change-Id: I5b82c482fa579f357cc67e38b86e6fe587f18ded
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Christian Ehrlicher 2018-12-16 15:48:04 +01:00
parent 34e4a8ef6d
commit 7bebdb472a
4 changed files with 8 additions and 3 deletions

View File

@ -284,6 +284,7 @@ Qt::DropAction QDrag::exec(Qt::DropActions supportedActions, Qt::DropAction defa
return d->executed_action;
}
#if QT_DEPRECATED_SINCE(5, 13)
/*!
\obsolete
@ -311,6 +312,7 @@ Qt::DropAction QDrag::start(Qt::DropActions request)
d->executed_action = QDragManager::self()->drag(this);
return d->executed_action;
}
#endif
/*!
Sets the drag \a cursor for the \a action. This allows you

View File

@ -74,7 +74,10 @@ public:
QObject *source() const;
QObject *target() const;
#if QT_DEPRECATED_SINCE(5, 13)
QT_DEPRECATED_X("Use QDrag::exec() instead")
Qt::DropAction start(Qt::DropActions supportedActions = Qt::CopyAction);
#endif
Qt::DropAction exec(Qt::DropActions supportedActions = Qt::MoveAction);
Qt::DropAction exec(Qt::DropActions supportedActions, Qt::DropAction defaultAction);

View File

@ -646,7 +646,7 @@ void QColorWell::mouseMoveEvent(QMouseEvent *e)
drg->setMimeData(mime);
drg->setPixmap(pix);
mousePressed = false;
drg->start();
drg->exec(Qt::CopyAction);
}
#endif
}
@ -1131,7 +1131,7 @@ void QColorShowLabel::mouseMoveEvent(QMouseEvent *e)
drg->setMimeData(mime);
drg->setPixmap(pix);
mousePressed = false;
drg->start();
drg->exec(Qt::CopyAction);
}
#endif
}

View File

@ -324,7 +324,7 @@ void QLineEditPrivate::drag()
data->setText(control->selectedText());
QDrag *drag = new QDrag(q);
drag->setMimeData(data);
Qt::DropAction action = drag->start();
Qt::DropAction action = drag->exec(Qt::CopyAction);
if (action == Qt::MoveAction && !control->isReadOnly() && drag->target() != q)
control->removeSelection();
}