Dear all,

I have two custom models associated with views and I would like to drag
from model A and drop into model B.

Model B has overloaded supportedDropActions and returns Qt::LinkAction

Model A has overloaded supportedDragActions and returns Qt::MoveAction |
Qt::LinkAction

This does not work as the cursor turns to a forbidden sign when dragging
over B.

If model A supportedDragActions returns Qt::LinkAction only, then this
works.



If I look to the source code of QAbstractItemViewPrivate, i find in
canDecode(QDropEvent * e):

            if (mime->hasFormat(modelTypes.at(i))
               && (e->dropAction() & model->supportedDropActions()))
                return true;

Which explains the issue, the event handler does not check the event's
possible drop actions and does not call setDropAction if the proposed
action is not supported.

Is this a bug or a feature?

Thanks
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to