summaryrefslogtreecommitdiffstats
path: root/examples/doc/openreadme.qdoc
blob: 97e9a0422d3b9190a86cb92ab039e4be819f846a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example openreadme
    \ingroup qtifwexamples
    \title Open ReadMe Example

    \brief Using a component script to add a check box for opening the readme
    file to the final installer page.

    \image qtifw-examples-openreadme.png

    \e{Open ReadMe} illustrates how to use the \c Component() function to add a
    check box to the installation finished page and to open the readme file if
    end users select the check box.

    \include installerfw-examples-configuring.qdocinc

    \quotefile openreadme/config/config.xml

    \include installerfw-examples-packaging.qdocinc

    \list
        \li The \c <Default> element is set to \c true to preselect the
            component in the installer.
        \li The \c <Script> element specifies the file name of the JavaScript
            file that is loaded to perform operations.
        \li The \c <UserInterfaces> element specifies the file name of the
            installer page (.ui file) to use.
    \endlist

    \quotefile openreadme/packages/or.qtproject.ifw.example.openreadme/meta/package.xml

    \section1 Opening Files After Installation

    In installscript.qs, we use the \c Component() function to connect to the
    \c installationFinishedPageIsShown signal when the installation is complete
    and to the \c installationFinished signal when the end users click
    \uicontrol Finish (\uicontrol Done on OS X):

    \quotefromfile openreadme/packages/or.qtproject.ifw.example.openreadme/meta/installscript.qs
    \skipto Component()
    \printuntil }

    We call the component::createOperations() function to override the default
    method for creating operations:

    \printuntil }

    If the installation is successful, we call the installer::addWizardPageItem()
    function to replace the last installer page with a custom page that contains
    the \uicontrol {OpenReadMe} check box:

    \printuntil /^\}/

    We set the \c readMeCheckBox to \c checked by default and use the
    QDesktopServices::openURL() function to open the readme file:

    \printuntil /^\}/

    \include installerfw-examples-generating.qdocinc
*/