[Qt-interest] Sort Indicator For QTableView Not Showing Up
David Boosalis
david.boosalis at gmail.com
Wed Feb 8 15:20:44 CET 2012
I think there is a bug in QTableView. If you switch to QTreeView and turn
off root decorations you get a table. And all the columns will be sortable
On Tue, Feb 7, 2012 at 10:29 PM, Dan Alcantra <dalcantra at yahoo.com> wrote:
> Hi Qt Experts.
>
> I am using a QTableView and have trouble with the sort indicator not
> showing up. This is on Qt 4.7 and 4.8. I even tried to omplement it with
> the Qt ItemView example call freezedemo.
>
> In this example I created a slot for the signal sectionClicked(int). And
> in this slot I have:
>
> void FreezeTableWidget::sectionClickedSlot(int logicindex)
> {
> qDebug() << "sort to " << logicindex;
> frozenTableView->sortByColumn(logicindex,Qt::DescendingOrder);
>
> frozenTableView->horizontalHeader()->setSortIndicator(logicindex,Qt::DescendingOrder);
> frozenTableView->horizontalHeader()->setSortIndicatorShown(true);
> }
>
> It does the sort ok, but I do not see the sort indicator on anything but
> the first column. And after the frozenTableView gets created I added the
> following code:
>
> frozenTableView->setSortingEnabled(true);
> init();
> frozenTableView->horizontalHeader()->setClickable(true);
> frozenTableView->horizontalHeader()->setSortIndicatorShown(true);
>
>
> Any ideas on how to get the sort indicator to show up ?
>
> Thanks
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20120208/b887bf59/attachment.html
More information about the Qt-interest-old
mailing list