自定义 QWIzard 中的按钮?

发布于 2024-09-11 08:11:10 字数 524 浏览 0 评论 0原文

QWizard有一些与按钮相关的选项如下:

    NoDefaultButton
    NoBackButtonOnStartPage
    NoBackButtonOnLastPage
    DisabledBackButtonOnLastPage
    HaveNextButtonOnLastPage
    HaveFinishButtonOnEarlyPages
    NoCancelButton
    CancelButtonOnLeft
    HaveHelpButton
    HelpButtonOnRight

现在这些选项对我来说还不够,有什么办法可以进行定制吗?

例如,将 QWizardPage 设置为最终页面后,“下一页”按钮仍然存在,因为该页面原本有下一页。

我想要的是将“下一步”更改为“完成”,而不是再增加一个“完成”按钮。

另一个例子是,在第一页,我希望显示“后退”按钮,但被禁用。

如何更灵活地控制这些按钮? 我想让一些按钮消失,一些按钮被禁用。

QWizard have some options related to the buttons as follows:

    NoDefaultButton
    NoBackButtonOnStartPage
    NoBackButtonOnLastPage
    DisabledBackButtonOnLastPage
    HaveNextButtonOnLastPage
    HaveFinishButtonOnEarlyPages
    NoCancelButton
    CancelButtonOnLeft
    HaveHelpButton
    HelpButtonOnRight

Now these options are not enough to me, is there any way to do the customization??

For example, after setting a QWizardPage as a final page, the "next" button is still there since the page originally have next page.

What I want is to change "next" to "finish" instead of one more "finish" button.

Another example is that at the first page, I want the "back" button shows up but is disabled.

How can I control these buttons in a more flexible way?
I want make some buttons disappear and some be disabled.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月牙弯弯 2024-09-18 08:11:18

如果您使用以下

QAbstractButton * QWizard::button ( WizardButton which ) const

参数调用以下函数:

QWizard::NextButton

那么您应该获得指向“下一步”按钮的指针。

剩下要做的唯一一件事就是当您位于最后一页(最后一页之前)时,调用按钮的 setVisible(bool) 函数?

我从来没有这样做过,只是想帮助你。

If you call the follwing function:

QAbstractButton * QWizard::button ( WizardButton which ) const

with following argument:

QWizard::NextButton

then you should get a pointer to the "Next" button.

The only thing left to do is to call setVisible(bool) function of the button when you are one the last but one (pre-last) page?

I have never done this, just tried to help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文