[Qt-interest] Auto increase the window size

Andre Somers andre at familiesomers.nl
Thu Dec 30 09:30:16 CET 2010


Op 30-12-2010 2:04, yogesh upreti schreef:
> Hello group,
> I have simple QScrollArea where I add rows of widgets (like a form 
> with lable and line edit).
> My problem is I want the QScrollArea to expand till a certain height 
> and then it should show the scrollbar.
> But when I keep on adding widgets to scrollarea it shows the scroll 
> bar but doesn't expand the main window.
> What kind of size policy should I use so that scroll area and the main 
> window should expand with it??
>
There is no style policy that will achieve that. You'll have to code it 
yourself. The whole idea of a QScrollArea is, that it's outer size is 
independent of the size of it's contents.

André




More information about the Qt-interest-old mailing list