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

QTreeWidget items disappear after performing drag and drop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1: Critical P1: Critical
    • 5.13.2, 5.14.0
    • 5.12.1, 5.12.4, 5.13.0
    • GUI: Drag and Drop
    • None
    • macOS 10.14.6
    • macOS
    • 137cbd1c7200809cc3945c6d4b6deee560cdc9fc

      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();
      }
      

        1. 1.png
          1.png
          11 kB
        2. 2.png
          2.png
          11 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes