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

Selected item in QTreeWidget cannot be dragged when CTRL-key is pressed

    XMLWordPrintable

Details

    • All
    • dfb4697e4a (qt/qtbase/dev) b1703b0c18 (qt/qtbase/6.3) 06207d19c6 (qt/qtbase/6.2) 06207d19c6 (qt/tqtc-qtbase/6.2) b1703b0c18 (qt/tqtc-qtbase/6.3) dfb4697e4a (qt/tqtc-qtbase/dev)

    Description

      In a QTreeWidget (QAbstractItemView) with single selection and drag&drop enabled an item is selected. When pressing the CTRL key and start dragging the selected item drag&drop does not work. Dragging other not selected items works as intended.
      To reproduce the issue use the following Qt manual test example and one of the `Anonymous User` entries.

      Upon further inspection the QAbstractItemView method selectionCommand
      is responsible for this faulty behaviour. In case of single selection mode the already selected item should not be deselected when the CTRL key is pressed and the item is clicked again. This should only happen in case of multi selection mode to add or remove the item from the current selection.

      Just noticed the issue is also present in multi selection mode. It looks like instead of handling CTRL key and MouseButtonPressed event one need to handle CTRL key and MouseButtonReleased event, as the drag&drop action is always started with a MouseButtonPressed event followed by a MouseMove event.

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            volkerenderlein Volker Enderlein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes