1

I have a QDialog like this:

enter image description here

I have added a QScrollArea to this QDialog like this:

enter image description here

What I want is When the user expands QDialog , the QScrollArea should also expand with it.

I have tried several properties of QScrollArea like verticalScrollBarPolicy horizontalScrollBarPolicy, sizeAdjustPolicy, but nothing seems to work.

Can someone suggest how to accomplish this?

Sumeet
  • 8,086
  • 3
  • 25
  • 45
  • 1
    [This](http://stackoverflow.com/questions/5249224/controls-insist-on-being-too-large-and-wont-resize-in-qtdesigner) maybe? – Steeve Feb 17 '17 at 10:12
  • Please check link above provided by Steeve .. that will solve your issue – Max Go Feb 17 '17 at 10:19
  • Possible duplicate of [Controls insist on being too large, and won't resize, in QtDesigner](http://stackoverflow.com/questions/5249224/controls-insist-on-being-too-large-and-wont-resize-in-qtdesigner) – Toby Speight Feb 17 '17 at 10:32

1 Answers1

1

For the dialog to resize its child widgets, it must have a layout. Set a layout on the dialog. Do not change any of QScrollArea's properties: they only affect the area itself and its children, and have nothing to do with how the parent widget (the dialog) might manage the scroll area's geometry().

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313