问题
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