[Qt-interest] QTreeWidget does not show horizontal scrollbar

wim.delvaux at adaptiveplanet.com wim.delvaux at adaptiveplanet.com
Fri Mar 13 00:03:37 CET 2009


Hi all,

I have this 'standard' QTreeWidget, created as 

          CSDILayout = new QTreeWidget();
          CSDILayout->setColumnCount( 1 );
          QTreeWidgetItem * TWI = new QTreeWidgetItem();
          TWI->setText( 0, tr("Items") );
          CSDILayout->setHeaderItem( TWI );
          CSDILayout->setSelectionMode( QAbstractItemView::SingleSelection );
          CSDILayout->setSelectionBehavior( QAbstractItemView::SelectRows );
          CSDILayout->setRootIsDecorated( false );
          CSDILayout->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );

When I add items and subitems to this single column treewidget and as such
create a deep tree, no horizontalscrollbar appears when items fall outside of 
the view area of the treewidget.

When I make the widget smaller (it is in a dock area) it shows 'elides' on the 
items that are too long to show but never shows a scrollbar.

What can I do ?

W



More information about the Qt-interest-old mailing list