user506710
user506710

Reputation:

PyQt4 - Maximize window along with inside widgets

I have a main window and I want that when I maximize it the widgets inside it should automatically be resized ....

Is there any way I can do that ????

Upvotes: 1

Views: 1192

Answers (2)

Eli Bendersky
Eli Bendersky

Reputation: 273456

Yes. Use layout objects (such as QHBoxLayout or QGridLayout) to organize your widgets inside, and set the widgets' resize modes accordingly. Note that standard Qt-supplied widgets support resizing by default.

Upvotes: 2

Pavel Bazant
Pavel Bazant

Reputation: 530

If you want to save you a lot of work, don't hand-code the ui. Use Qt Creator to create a ui file and then load this file dynamically using PyQt4.uic module. There is also a "static" approach that generates python code from Qt Creator ui files.

Upvotes: 1

Related Questions