QTableView: disable row header
lol, just realized I was posting my question on a deprecated forum (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
Re: QTableView: disable row header
Did you try this?
Code:
_ui.view->verticalHeader()->hide();
Re: QTableView: disable row header
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
Re: QTableView: disable row header
Quote:
Originally Posted by mattie
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.
Re: QTableView: disable row header
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
Re: QTableView: disable row header
Quote:
Originally Posted by mattie
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.
Re: QTableView: disable row header
ok, no problem then, and I'm already returning empty variants :)