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

      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

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            andysh Andy Shaw
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes