PDA

View Full Version : QTableView: disable row header



mattie
7th March 2006, 21:59
lol, just realized I was posting my question on a deprecated forum (http://www.qtforum.org/thread.php?threadid=15877) (already wondered why there seemed to be 2 similar fora ;))

anyway, here is another question:
I have a qtableview which displays mail items. I want to disable the row header view. How do I do that? (tried setting it to NULL :rolleyes: ) Is a table view actually the right choice in this case? I first tried qlistview, to realise that it has only one column? qtreeview would work too I guess, but is maybe too complicated for my purpose, since I don't have a hierarchical structure?

thanks

matthias

jacek
7th March 2006, 22:21
Did you try this?
_ui.view->verticalHeader()->hide();

mattie
7th March 2006, 22:32
that does the trick, thanks!

but I wonder how to find things like that easily. It would be handy if Qt assistant would provide a list of all methods present in a class , including the inherited ones. This is not possible I guess? I checked the class for all hide occurences, and also the QAbstractItemView class, but didn't check the QWidget class as I thought was unrelated to table.
Because now I hide the widget, but I hope/guess Qt is smart enough to drop the header view generation also? I want to get rid of the (possibly minor) overhead a vertical header adds (I guess it has some overhead on thousands of items).

matthias

jacek
7th March 2006, 22:47
It would be handy if Qt assistant would provide a list of all methods present in a class , including the inherited ones. This is not possible I guess?
But of course it's possible --- look for "List of all members, including inherited members" link.

mattie
7th March 2006, 22:58
lol, oops :o programming off hours doesn't yield a high concentration level in my case, I'm afraid ;)

or I'm too much in a hurry to get done as much as possible before the morning comes ;)
I didn't read well, sorry

Chicken Blood Machine
8th March 2006, 04:58
Because now I hide the widget, but I hope/guess Qt is smart enough to drop the header view generation also? I want to get rid of the (possibly minor) overhead a vertical header adds (I guess it has some overhead on thousands of items).

I don't think it's worth worrying about because since the header widget is hidden, it wont be painted (which is usually the major overhead). If you really care though, you can override headerData() to return empty QVariant objects.

mattie
8th March 2006, 12:16
ok, no problem then, and I'm already returning empty variants :)