帮助使用 qtdesigner for python 设计布局
我正在使用 Qtdesigner 为我的 python 应用程序生成 GUI。
问题是我手动制作了小部件,然后将其编译为 py.但后来我发现组件在最大化时没有调整大小。
因此,我在设计器中打开 .ui 文件,选择小部件的组框,然后右键单击它选择网格中的布局。
即使现在,小部件也不会在最大化时调整大小......
我还需要做其他事情吗???
多谢...
I am working on Qtdesigner for generating a GUI for my python app.
The problem is that I had manually made the widgets and then compiled it to py. But then I found out that the components did not resize when maximised.
So I opened the .ui file in designer and selected the group box for my widgets and chose layout in grid by right clicking on it.
Even now the widgets do not resize on maximising....
Do I have to do something else ???
Thanks a lot...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使小部件随窗口调整大小,您必须将布局应用于顶级对象(通常是QMainWindow),然后将新小部件放置在布局中您想要的位置(也可能是其他布局)更复杂的窗口)。
注意:只有在您将第一个小部件放入其中后,允许在主窗口上应用布局的菜单项才可用。
To have the widgets resized with the window, you must apply a layout to your top-level object (usually
QMainWindow
), and then place your new widgets where you want in the layout (and maybe other layouts for a more complicated window).NOTE: the menu items allowing to apply a layout on the main window will be available only once you have placed your first widget in it.