Sorry, I did not answer when I answered this question when I discovered what I was doing wrong. The code that confused me was in QAbstractItemView::startDrag():
if (d->defaultDropAction != Qt::IgnoreAction && (supportedActions & d->defaultDropAction))
defaultDropAction = d->defaultDropAction;
else if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove)
defaultDropAction = Qt::CopyAction;
The problem is that I did not set the defaultDropAction property in the widget, as in setDefaultDropAction( Qt::MoveAction );Therefore, startDrag () used CopyAction by default. If the defaultDropAction is Qt :: MoveAction, you can use the Ctrl keyboard to switch the drag and drop to the copy action, which is my desired behavior.
Qt, , . .
: , defaultDropAction - Qt:: MoveAction.