PDA

View Full Version : Item of qtreewidget opened and String in Column adjusted in QT4??



darpan
21st September 2006, 10:20
Hi,
I am new to QT4 and I want to show items of qtreewidget be opened when the tree displayed ,earlier i am working with qt3 and using
item->setopen(TRUE);

Following are my problems:-

(1) which will be used in qt4 to show items as opened when tree displayed.
(2) How i can adjust column size of QTreeWidget in QT Designer or through coding,so that when i scroll the items appears in column adjusted according to their string size.
(3) How I can show Horizontal scroll bar added to qtreewidget.

Thanks and Regards

jpn
21st September 2006, 10:37
(1) which will be used in qt4 to show items as opened when tree displayed.


Qt 4.1: QTreeWidget::setItemExpanded()
Qt 4.2: QTreeWidgetItem::setExpanded() (http://doc.trolltech.com/4.2/qtreewidgetitem.html#setExpanded)




(2) How i can adjust column size of QTreeWidget in QT Designer or through coding,so that when i scroll the items appears in column adjusted according to their string size.

QHeaderView provides a bunch of methods for resizing sections, setting their resize modes, and properties like whether the last column is stretched or not and so on.. It is accessible through QTreeView::header().



(3) How I can show Horizontal scroll bar added to qtreewidget.

QAbstractScrollArea::setHorizontalScrollBarPolicy( ) (http://doc.trolltech.com/4.1/qabstractscrollarea.html#horizontalScrollBarPolicy-prop)