Qt installer framework hide or disable buttons

旧巷老猫 提交于 2019-12-08 04:26:47

问题


I want to hide or freeze the back button on a page ( to be more specific, License Agreement Page). I tried editing control.qs with few methods but it doesn't seem to work. Following is one of them

Controller.prototype.LicenseAgreementPageCallback = function()
{
    var widget = gui.currentPageWidget();
    if (widget != null) 
    {
        widget.BackButton.setVisible(false) ;
    }
}

回答1:


I'm facing a similar problem trying to keep hide the Next button in the Target Directory page under certain conditions.

But your case may be easier:

1) You should use a global boolean variable set to true when you enter the License Agreement page.

2) When you enter the previous page test the value of this global: if true then force a click on the next page (gui.click(buttons.NextButton);).

Yes, it's a dirty workaround ;)




回答2:


I think you could try what I've proposed here: Qt installer framework: remove radio buttons from uninstaller. Even if it wasn't accepted, that what I used in my installer, so I'm pretty confident it's working!




回答3:


For the wizard BackButton specifically, it automatically disables itself if there are no pages before the current page a la the Introduction page.

From QtScript this can be accomplished by removing any dynamic pages before the current page with installer.removeWizardPage and disabling all default pages before the current page with installer.setDefaultPageVisible(QInstaller.Introduction, false).



来源:https://stackoverflow.com/questions/35100012/qt-installer-framework-hide-or-disable-buttons

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!