PDA

View Full Version : QTreeViews should not expand!



zwwe
13th February 2008, 14:47
Hi!

I have written my own model based on a QAbstractTableModel
I first tried to use QTableView as View, but it doesn't meet my requirements, I do not want to have header for rows. So I decided to use QTreeView, which is nearly perfect. The only problem I am faced to is that I have an expand button in front of every row, if I click it the row expands and its contents become the same as the first level's.
I can disable this expanding by setItemExpandable(false), but I still have the expand button. How can I make this button disappear?

Thank you very much for your help!

zwwe

jpn
13th February 2008, 14:52
See QTreeView::rootIsDecorated

jacek
13th February 2008, 14:52
It seems that your model's implementation is wrong. How did you implement hasChildren()?

Can't you use QTableView and just hide the vertical header?