简体   繁体   中英

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 ????

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM