theprobe
11th January 2011, 16:05
Hi,
I have a QTreeView that is populated by setModel:
model = new MyModel();
myTreeView->setModel(model);
When I do this the first time, my model is empty, but is subsequently filled.
The tree view appears as expected.
However, when I do this with a model that is not empty, I find that unwanted
and unneccesary horizontal scrollbars are appearing - the row is not wide
enough to warrant one.
If I do:
myTreeView->resizeColumnToContents(0);
the scrollbars go away, but I don't want to have to force my larger items to be
fully open. Any pointers?
Thanks in advance
I have a QTreeView that is populated by setModel:
model = new MyModel();
myTreeView->setModel(model);
When I do this the first time, my model is empty, but is subsequently filled.
The tree view appears as expected.
However, when I do this with a model that is not empty, I find that unwanted
and unneccesary horizontal scrollbars are appearing - the row is not wide
enough to warrant one.
If I do:
myTreeView->resizeColumnToContents(0);
the scrollbars go away, but I don't want to have to force my larger items to be
fully open. Any pointers?
Thanks in advance