Dakons blog

Erstellt: 6. 2. 2008, 07:00

Sorting, anyone?

Tags:

I like that model/view stuff. Really. Even if some of my last commits added lines of code it felt like I removed hundreds of lines as the new code is much more readable and straightforward. But there are some things that are simply not there (or they are hidden so good that I can't find them):

QTreeView::resizeColumnsToContent()
It simply does not exist. I have no idea why: resizeColumToContents(int) is there and both functions are in QTableView.
query sort settings
Yes, I know about QTreeView::sortByColumn(). But once you have set this (e.g. by clicking on the header) how can you find out which column is currently the sorting one? Or the direction? My current hack will probably just store it once the mymodel::lessThan() is called. But this is ugly. Really, really ugly. I mean, this stuff must be stored somewhere in the view. Why can't I simply query it?
Anbieterkennzeichnung