Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.3, 5.14.1, 5.15.0 Beta1
-
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.