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

QTreeWidget items disappear after performing drag and drop

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Duplicate
    • Affects Version/s: 5.12.1, 5.12.4, 5.13.0
    • Fix Version/s: 5.13.2, 5.14.0
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Environment:
      macOS 10.14.6
    • Platform/s:
      macOS
    • Commits:
      137cbd1c7200809cc3945c6d4b6deee560cdc9fc

      Description

      Reproduced on macOS 10.14.6 in Qt 5.12.1, 5.12.4, 5.13.0, but not in 5.9.6.

      Not reproduced on Windows.

       

      When performing drag and drop in QTreeWidget with the drag and drop mode set to QAbstractItemView::InternalMove some items disappear. The attached screenshots show the initial widget state and the state after dropping item 1 on item 0.

      Sample code:

      #include <QApplication>
      #include <QTreeWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QTreeWidget widget;
          widget.setColumnCount(1);
          widget.headerItem()->setText(0, "Tree");
          widget.setDragEnabled(true);
          widget.setDragDropMode(QAbstractItemView::InternalMove);
       
          QList<QTreeWidgetItem*> items;
          for(int i = 0; i < 5; ++i)
          {
              items.append(new QTreeWidgetItem((QTreeWidget*)0, {QString("Item: %1").arg(i)}));
          }
          widget.insertTopLevelItems(0, items);
          widget.show();
      
          return app.exec();
      }
      

        Attachments

        1. 1.png
          1.png
          11 kB
        2. 2.png
          2.png
          11 kB

          Issue Links

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

            Activity

              People

              • Assignee:
                qt.team.quick.subscriptions Qt Quick and Widgets Team
                Reporter:
                artem.kostyukovich@duallab.com Artem Kostyukovich
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes