KillGabio
23rd January 2012, 03:39
i ve read in this forum the next statement
Hi
Using Qt 4.1.3 (release, linux)
The actual problem is in QTableView.
It is not possible to enable sorting in QTableView as the actual connect to sortByColumn is made in QTableWidget and not in QtableView.
If you compare this with QTreeView, you'll notice that these connects are moved to QTreeView.
This should be done by Trolltech guys as well for QTableView.
Just compare code difference in qt source where they connect sortByColumn and you'll understand.
BTW: When using sort function in your widget you'll notice that the sort works fine in QTableView. Only the connections when clicking the header are made at the wrong place (In QTableWidget instead of in QTableView).
I hope this explains the original problem in this topic.
And I hope they come with a fix. By the way I did not check snapshot code to see if it is already fixed.
in fact im working with a QTableView that is connected to a QsqlQueryModel, the problem is that when i do
tableView.setSortingEnabled (true)
or
tableView.sortByColum (0, Qt::AscendingOrder)
for example, it has no effect...
any solution with QtableView? shoul i change this to a QtableWidget?
thanks everyone
Hi
Using Qt 4.1.3 (release, linux)
The actual problem is in QTableView.
It is not possible to enable sorting in QTableView as the actual connect to sortByColumn is made in QTableWidget and not in QtableView.
If you compare this with QTreeView, you'll notice that these connects are moved to QTreeView.
This should be done by Trolltech guys as well for QTableView.
Just compare code difference in qt source where they connect sortByColumn and you'll understand.
BTW: When using sort function in your widget you'll notice that the sort works fine in QTableView. Only the connections when clicking the header are made at the wrong place (In QTableWidget instead of in QTableView).
I hope this explains the original problem in this topic.
And I hope they come with a fix. By the way I did not check snapshot code to see if it is already fixed.
in fact im working with a QTableView that is connected to a QsqlQueryModel, the problem is that when i do
tableView.setSortingEnabled (true)
or
tableView.sortByColum (0, Qt::AscendingOrder)
for example, it has no effect...
any solution with QtableView? shoul i change this to a QtableWidget?
thanks everyone