JimDaniel
8th January 2008, 21:39
Hi, this has really been bugging me.
I have a QTreeWidget in a QVBoxLayout and that layout is set to a QGroupBox. For whatever reason, the treeview doesn't recognize when it needs to scroll horizontally, and if I manually call setHorizontalScrollPolicy(Qt::ScrollBarAlwaysOn); the scroll bar is visible, but there is no bar to scroll. The strangest part is that the vertical scroll works just fine.
Here is some of my code...I didn't put the code where I populate the treeview as its long and to my mind irrelevant.
treeWidget = new QTreeWidget();
treeWidget->setColumnCount(1);
verticalLayout = new QVBoxLayout();
verticalLayout->addWidget(treeWidget);
groupBox->setLayout(verticalLayout);
I've tried populating the treeview both before its set to the layout and after. No change.
Does anyone have any ideas? Seems like it should work...
I have a QTreeWidget in a QVBoxLayout and that layout is set to a QGroupBox. For whatever reason, the treeview doesn't recognize when it needs to scroll horizontally, and if I manually call setHorizontalScrollPolicy(Qt::ScrollBarAlwaysOn); the scroll bar is visible, but there is no bar to scroll. The strangest part is that the vertical scroll works just fine.
Here is some of my code...I didn't put the code where I populate the treeview as its long and to my mind irrelevant.
treeWidget = new QTreeWidget();
treeWidget->setColumnCount(1);
verticalLayout = new QVBoxLayout();
verticalLayout->addWidget(treeWidget);
groupBox->setLayout(verticalLayout);
I've tried populating the treeview both before its set to the layout and after. No change.
Does anyone have any ideas? Seems like it should work...