我是靠谱客的博主 搞怪电脑,最近开发中收集的这篇文章主要介绍《Qt5+安装包制作(Qt Installer Framework)》一-Controller ScriptingController Scripting,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部