Details
-
Suggestion
-
Resolution: Fixed
-
P1: Critical
-
None
-
7d0017cda (dev)
Description
QTreeWidget has the function https://doc.qt.io/qt-5/qtreewidget.html#supportedDropActions which can be used to edit the supported drop actions. However, it does not have a similar member function to change the supported drag actions. This is problematic because QAbstractItemModel::setSupportedDragActions is now obsolete meaning there is no more an obvious way to edit the supported drag actions in a QTreeWidget.
The only way to change the supported drag actions for QTreeWidget that I've discovered is by overriding QTreeWidget::supportedDropActions because by default QAbstractItemModel::supportedDragActions return value is the same as that of supportedDropActions (documented at https://doc.qt.io/qt-5/qabstractitemmodel.html#supportedDragActions). This doesn't feel very intuitive but may work in some cases. Unfortunately, it gets problematic once the QTreeWidget needs to support a different set of drop and drag actions which currently seems impossible.
Adding the function QTreeWidget::supportedDragActions which functions logically similarly to supportedDropActions would fix the problem.