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

QTreeWidget: "edit: editing failed"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.8.2, 5.0.0
    • Widgets: Itemviews
    • None
    • Windows 7 32bit, Qt 4.8.2, mingw

    Description

      Steps to reproduce:

      1) create a form with QTreeWidget and a push button
      2) connect a push button's signal "clicked()" to a slot
      3) in a slot create a new QTreeWidgetItem, add it to the view and start editing.
      4) Compile and run
      5) Start clicking on a push button quickly

      Result:

      Sometimes I see "edit: editing failed" in stderr, and the new item doesn't open the editor. Code:

      void Test::slotAdd()
      {
          QTreeWidgetItem *i = new QTreeWidgetItem(ui->tree, QStringList() << "Name" << "Data");
          i->setFlags(i->flags() | Qt::ItemIsEditable);
      
          ui->tree->addTopLevelItem(i);
          ui->tree->setCurrentItem(i, QItemSelectionModel::ClearAndSelect);
          ui->tree->editItem(i);
      }
      

      Test project is attached.

      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
            dmitry64 Dmitry
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes