QWizardPages 保持自己的最小尺寸
我正在使用 Qt(Windows XP 32 位上的版本 4.6,并在 Qt Creator 2.0.0 中编译)并尝试让 QWizard 来工作。
第一个问题:
到目前为止,我的QWizard中有三个QWizardPages。每个页面都应用了 QVBoxLayout 作为其布局。我的第一页内容非常小(只有三行 QLabel),但由于某种原因,QLabel 和“< Back”、“Next >”之间有相当多的空白。和“取消”按钮窗格。我希望每个页面根据其内部内容具有最少的空白。过去,当我将 QVBoxLayout 放入无父 QWidget(它自己的窗口)中时,窗口总是足够小以修复 QVBoxLayout。现在有额外的空白。是否有一些选项我必须关闭或打开,以便 QWizardPages 尽可能小?
第二页(很可能与第一页相关)问题:
另外,我的第二页比第一页大得多,所以当我到达第二页并返回时到第一页,第一页保持与第二页相同的大小,但只有在我访问第二页之后。这是一个错误吗?
执行 a 时
move(50, 50);
我所做的唯一几何设置是在 QWizard 构造函数中 。没有调整大小...没有明确的内容。我试图让布局发挥其魔力。
感谢您的提前帮助。
I'm working with Qt (version 4.6 on Windows XP 32-bit and compiling in Qt Creator 2.0.0) and trying to get a QWizard to work out.
First Problem:
I have three QWizardPages in my QWizard so far. Each page has a QVBoxLayout applied as it's layout. My first page has very small content (just a three line QLabel) but for some reason there is quite a bit of white space between the QLabel and the "< Back", "Next >" and "Cancel" button pane. I want each page to have the minimum amount of white space based on the content inside it. In the past, when I've put a QVBoxLayout in a parentless QWidget (it's own window), the window was always just small enough to fix the QVBoxLayout. Now there is extra whitespace. Is there some option that I have to turn off or on so that the QWizardPages are as small as possible?
Second (and mostly likely related to the first) Problem:
Also, my second page is much larger than my first page, so when I get to the second page and come back to the first page, the first page maintains the same size as the second page but only after I have visited the second page. Is this a bug?
The only geometry setting I am doing is when I do a
move(50, 50);
in the QWizard constructor. No resizes... nothing explicit. I'm trying to let the layouts do their magic.
Thanks for your help in advanced.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决这个问题,我创建了 QWizard 的子类并创建了一个如下所示的私有插槽:
并使其在每次页面更改时调用它,如下所示:
To fix this problem, I created a child class of QWizard and created a private slot like this:
And made it had it called every time the page was changed, like so: