Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.3.0
-
None
-
Ubuntu 14.04 (amd64)
Description
First I start the addressbook example (widgets/itemviews/addressbook), and add an entry with the name "a" and then I add an entry with the name "b".
I then see a table where the first row contains "a" and the second row contains "b".
The first time I click the header "Name", the sorting of the rows is not changed but instead the triangle is turned up-side-down.
I would expect the first click to also change the order of the rows.
I think this patch fixes the problem
— old/addresswidget.cpp 2014-06-11 14:25:08.167624525 +0200
+++ new/addresswidget.cpp 2014-06-11 14:25:17.075624739 +0200
@@ -180,7 +180,7 @@
proxyModel->setFilterRegExp(QRegExp(newStr, Qt::CaseInsensitive));
proxyModel->setFilterKeyColumn(0);
- proxyModel->sort(0, Qt::AscendingOrder);
+ tableView->sortByColumn(0, Qt::AscendingOrder);
connect(tableView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),