Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87465

QTreeWidget: add virtual function supportedDragActions

    XMLWordPrintable

Details

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            miikapernu Miika Pernu
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes