creator-external-tools.qdoc 7.11 KB
Newer Older
1 2
/****************************************************************************
**
3 4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
5
**
6
** This file is part of the Qt Creator documentation.
7
**
8 9 10 11 12 13 14
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
15
**
16
** GNU Free Documentation License Usage
17 18
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
19 20 21 22
** 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: https://www.gnu.org/licenses/fdl-1.3.html.
23 24 25 26 27 28 29 30 31 32
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
33
    \contentspage {Qt Creator Manual}
34
    \previouspage creator-keyboard-shortcuts.html
35
    \page creator-editor-external.html
36
    \nextpage creator-task-lists.html
37 38 39 40

    \title Using External Tools

    You can use external tools directly from \QC. Qt Linguist,
41
    QML preview tools, the
42 43 44 45
    default text editor for your system, and the \c sort tool are preconfigured
    for use. You can change their default configurations and configure new
    tools.

46 47 48
    To run the tools, select \uicontrol Tools > \uicontrol External, or use the
    \c x filter in the locator.

49 50 51 52 53 54 55
    \section1 Using Qt Linguist

    You can use the Qt Linguist release manager tools, lupdate and lrelease,
    directly from \QC. The lupdate tool is used to synchronize source
    code and translations. The lrelease tool is used to create run-time
    translation files for use by the released application.

Leena Miettinen's avatar
Leena Miettinen committed
56 57
    To synchronize translation source (TS) files from a translator with the
    application code,
58
    select \uicontrol {Tools > External > Text > Linguist > Update Translations
59 60
    (lupdate)}.

Leena Miettinen's avatar
Leena Miettinen committed
61
    To generate from the TS files Qt message (QM) files that can be used by an
62
    application, select \uicontrol {Tools > External > Text > Linguist > Release
63 64 65
    Translations (lrelease)}.

    By default, the project .pro file is passed to the tools as an argument. To
66
    specify other command line arguments for the tools, select \uicontrol {Tools >
67 68
    External > Configure}.

69 70 71
    To open TS files in Qt Linguist, right-click a TS file in the
    \uicontrol Projects view and select \uicontrol {Open With} >
    \uicontrol {Qt Linguist} in the context menu.
72
    For more information about Qt Linguist, see \l{Qt Linguist Manual}.
73

74
    \section1 Previewing QML Files
75

76 77 78
    You can preview the current QML document in the QML Viewer (Qt Quick 1) or
    QML Scene (Qt Quick 2). The preview tools enable you to load QML documents
    for viewing and testing while you are developing an application.
79

80 81 82
    To preview the currently active QML file, select \uicontrol Tools >
    \uicontrol External > \uicontrol {Qt Quick} > \uicontrol {Qt Quick 1 Preview
    (qmlviewer)} or \uicontrol {Qt Quick 2 Preview (qmlscene)}.
83 84 85 86

    \section1 Using External Text Editors

    You can open files for editing in the default text editor for your system:
87
    Notepad on Windows and vi on Linux and \macos.
88
    To open the file you are currently viewing in an external editor, select
89 90 91
    \uicontrol Tools > \uicontrol External > \uicontrol Text >
    \uicontrol {Edit with Notepad} or \uicontrol {Edit with vi}, depending on
    your system.
92 93 94 95 96 97

    \QC looks for the editor path in the PATH environment variable
    of your operating system.

    \section1 Sorting Text Alphabetically

98
    To sort selected text alphabetically, select \uicontrol {Tools > External > Text
99 100 101 102
    > Sort Selection}. The \c sort tool takes the selected text as input and
    returns it in alphabetic order. By default, the output replaces the
    original selection in the code editor.

103
    To change the default configuration, select \uicontrol {Tools > External >
104 105 106 107 108
    Configure}.

    \section1 Configuring External Tools

    You can change the configuration of preconfigured tools and configure
109
    additional tools in \QC \uicontrol Options.
110

111 112
    \image qtcreator-external-tools.png

113 114 115 116
    To configure external tools:

    \list 1

117
        \li Select \uicontrol {Tools > External > Configure}.
118

119 120
        \li Select \uicontrol {Add > Add Tool}
            to add a new tool. You can also select \uicontrol {Add Category} to add a
121 122
            new category.

123
        \li In the \uicontrol Executable field, specify the executable to run. If the
124 125 126
            executable is found in your system PATH variable, do not specify
            the path to it.

127
        \li In the \uicontrol Arguments field, specify optional arguments for running
128 129
            the executable.

130
        \li In the \uicontrol {Working directory} field, specify the path to the
131 132
            working directory.

133
        \li In the \uicontrol Output field, select how to handle output from the
134
            tool. You can ignore the output, view it in the \uicontrol {General
135 136 137
            Messages} output pane, or replace the selected text with the
            output in the code editor.

138 139 140 141 142 143 144
        \li In the \uicontrol {Error output} field, select how to handle error
            messages from the tool.

        \li In the \uicontrol Environment field, select \uicontrol Change to modify
            environment variable values for build and run environments in
            the \uicontrol {Edit Environment Changes} dialog. For more information
            about how to add and remove variable values, see \l{Batch Editing}.
145

146
        \li Select the \uicontrol {Modifies current document} check box to make sure
147 148 149
            that if the current document is modified by the tool, it is saved
            before the tool is run and reloaded after the tool finishes.

150
        \li In the \uicontrol Input field, specify text that is passed as standard
151 152 153 154
            input to the tool.

    \endlist

155
    The category and tool are added to the \uicontrol {Tools > External} menu.
156 157

    If you change the configuration of preconfigured tools, you can later
158
    revert the changes by selecting the \uicontrol Reset button.
159 160 161

    The tool configurations that you add and modify are stored in XML format in
    the user configuration folder. For example,
162
    \c {~/config/QtProject/qtcreator/externaltools}
163
    on Linux and \macos and
164
    \c {C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools}
165 166 167 168
    in Windows. To share a configuration with other users, copy an XML
    configuration file to the folder.

*/