如何在应用程序运行时调整窗口上小部件的大小?
我有一个包含更多小部件的应用程序 - 一个 QGRaphicsView 小部件和 2 个 QListView 小部件。
如何在应用程序运行时调整这些小部件的大小?也就是说,从小部件的边缘向上、向下、向左或向右拖动,它就会重新调整大小。我做了一些研究,显然停靠小部件可以毫无问题地调整大小。但还有其他办法吗?
I have an application that contains more widgets - a QGRaphicsView widget and 2 QListView widgets.
How can I make these widgets resizable while the application is running? That is drag up and down, left or right from the widgets' margins and it gets re-sized. I did some research and apparently dock widgets can be re-sized without problems. But is there any other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
小部件应包含在布局中,这将导致它们在调整父窗口大小时自行调整大小。您可以允许使用拆分器在两个小部件共享的空间内调整它们的大小。如果没有更多细节,就很难进一步推荐任何东西。
The widgets should be contained within layouts which will cause them to resize themselves when the parent window is resized. You can allow two widgets to be resized within a space that they share using splitters. Without more detail, it's difficult to recommend anything further.