Re: QTreeWidget questions
Quote:
Question one:
I have a QTreeWidget with items and I want to grab the collapsed/expanded but it returns a QModelIndex. So how do I grab a collapse or expand that will give me back a QTreeWidgetItem? All the post I've read about this never really answered the question!
connect itemExpanded and itemCollapsed signal to your slots
Quote:
Question two:
How do you remove the column at the top? I only have one column and I don't like seeing the 0 at the top of the column. I've searched the doc's but might be missing it or it might be something done in QTDesigner.
use setItemHidden(headerItem(),true);
Re: QTreeWidget questions
The QTreeWidget doesn't have a signal collapsed or expanded. I thought I read that within the QT documenation http://doc.trolltech.com/4.1/qtreewi...l#itemExpanded is the better way to go....
Re: QTreeWidget questions
void QTreeWidget::itemExpanded ( QTreeWidgetItem * item ) [signal]
This signal is emitted when the specified item is expanded so that all of its children are displayed.
See also setItemExpanded() and isItemExpanded().
This is what the documentation says. So using this signal you can know that an item is expanded and also the item which is getting expnaded. Same applies for itemCollapsed.
Re: QTreeWidget questions
Thanks munna,
I must have been in the QTreeView (browsing back that is where I was although I don't know why.)
I found the correct documentation and now have it working.... Thanks for the help