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

QAbstractItemView: When clicking on an item that is being edited and the edit trigger is SelectedClicked it should just stop editing

    XMLWordPrintable

Details

    • 2f9543c2ef71e3b5b686ce07e84fd4372ce0535f (qt/qtbase/dev) fc47a6c701fc0f81f14e082b878553add99a90dd (qt/qtbase/6.2)

    Description

      QAbstractItemView: When clicking on an item that is being edited and the edit trigger is SelectedClicked it should just stop editing. However it currently stops editing and then starts editing again straight away.

      The following patch to the editabletreemodel example shows this problem occuring:

      --- mainwindow.cpp.old  Wed Jul 20 09:09:39 2011
      +++ mainwindow.cpp      Wed Jul 20 09:09:51 2011
      @@ -60,7 +60,7 @@
           view->setModel(model);
           for (int column = 0; column < model->columnCount(); ++column)
               view->resizeColumnToContents(column);
      -
      +    view->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
           connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
      
           connect(view->selectionModel(),
      

      Click on an item to select it then click to edit and then click to stop the edit on that same item. Note that it will continue to edit the item.

      The attached mytreeview.h can be used to workaround the problem.

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            andysh Andy Shaw
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes