[Interest] QSplitter + QScrollArea + QWidgetStack issues
Scott Aron Bloom
scott.bloom at onshorecs.com
Fri Mar 28 05:01:07 CET 2014
I have a dialogbox, with a vertical QSplitter as the top level layout..
on the left goes a QTreeWidget, on the right a QScrollArea
Inside the QScrollArea, there is a QWidgetStack in which multiple widgets are stacked.
Here is my problem, when it first comes up, I want the right hand side, to work as if the scroll area was not there. Essential, just the stacked widget. The user can then minimize and see the scroll bars.
I was hoping to use
scrollArea->maximumViewportSize(), but its not correct (too small).
Its laid out with Designer, so I don't believe it's a layout issue.. It works fine, except for the initial size.
To "kind" of get it to work, I go over each widget in the stacked widget, get the minimumSizeHint, I compute the largest combination of them. Then I pad for the splitter width + the calculated minimum size of the tree. Then I pad for the other widgets (a dialog button box outside the splitter etc etc)
But I just have to think, there should be some function somewhere, that I can call on a QScrollArea and say, find me an area that has no scroll bars, and use that as your initial size, and expand your parent widget.
Thanks in advance..
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140328/110988aa/attachment.html>
More information about the Interest
mailing list