Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Question about QAbstractItemModel::canDropMimeData()
Robert Hairgrove last edited by Robert Hairgrove
In my custom model's implementation of
Do I need to call
canDropMimeData()myself before proceeding with the actual implementation, or can I assume that the underlying framework has already called this before it calls
My custom model has its own implementation of
canDropMimeData() is there to see if a drop can occour - if it returns false dropMimeData() will not be called (otherwise canDropMimeData() would be useless).
@christian-ehrlicher : Thanks for the clear explanation. It is logical that the framework would call this function at some point. But I could not find any place in the Qt source code where
QTableViewor one of the other item view classes actually calls this. Can anyone please point it out?
It's the base class which is calling the function. See https://code.woboq.org/qt5/qtbase/src/widgets/itemviews/qabstractitemview_p.h.html#_ZN24QAbstractItemViewPrivate7canDropEP10QDropEvent
@christian-ehrlicher : Excellent ... thank you!