概述
Controller Scripting
For each installer, you can specify a control script that interacts with certain parts of the installer's UI or functionality. The control script can add and remove pages to the wizard, change existing pages, do additional checks, and interact with the UI by simulating user clicks. This allows for example unattended installations.
The script format has to be compatible with QJSEngine.
This section describes the functions that are called to implement such a control script. It also gives an overview of installer pages and the widgets that are available on each page, such as push buttons, radio buttons, and line edits.
Writing Control Scripts
A minimal valid script needs to contain at least a constructor, which can look like this:
function Controller() { }
The following example presents a more advanced script that uses the gui JavaScript global object methods to set a new page title and welcome message on the introduction page and to automatically click the Next button on the target directory page:
function Controller() { } Controller.prototype.IntroductionPageCallback = function() { var widget = gui.currentPageWidget(); // get the current wizard page if (widget != null) { widget.title = "New title."; // set the page title widget.MessageLabel.setText("New Message."); // set the welcome text } } Controller.prototype.TargetDirectoryPageCallback = function() { gui.clickButton(buttons.NextButton); // automatically click the Next button }
For more information about the JavaScript global objects that you can use in control scripts, see Scripting API.
最后
以上就是搞怪电脑为你收集整理的《Qt5+安装包制作(Qt Installer Framework)》一-Controller ScriptingController Scripting的全部内容,希望文章能够帮你解决《Qt5+安装包制作(Qt Installer Framework)》一-Controller ScriptingController Scripting所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复