[Qt-interest] Sorting a tableview

Zine eddine Bendjaballah zineeddine.b at gmail.com
Thu Mar 5 10:27:33 CET 2009


Hi,

In my program I use a QTableView widget to display data from a
QAbstractTableModel object.
The tableview displays two columns, I would like to make the first one
sortable, when clicked.
I've added these two lines:

tableView->setSortingEnabled(true);
tableView->sortByColumn(0);

The sorting sign did appear on the first column, but when I click this
column, the sorting didn't work.

So, what did I forgotten?

Regards.

-- 
Zine Eddine Bendjaballah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090305/b5d848af/attachment.html 


More information about the Qt-interest-old mailing list