creator-external-tools.qdoc 5.82 KB
Newer Older
1 2
/****************************************************************************
**
3
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** Contact: http://www.qt-project.org/legal
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
**
**
** GNU Free Documentation License
**
** 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.
**
**
****************************************************************************/

// **********************************************************************
// 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.
// **********************************************************************

/*!
    \contentspage index.html
27
    \previouspage creator-keyboard-shortcuts.html
28
    \page creator-editor-external.html
29
    \nextpage creator-task-lists.html
30 31 32 33

    \title Using External Tools

    You can use external tools directly from \QC. Qt Linguist,
34
    QML preview tools, the
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    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.

    \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.

    To synchronize ts files from a translator with the application code,
    select \gui {Tools > External > Text > Linguist > Update Translations
    (lupdate)}.

    To generate from the ts files qm translation files that can be used by an
    application, select \gui {Tools > External > Text > Linguist > Release
    Translations (lrelease)}.

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

58
    For more information about Qt Linguist, see \l{Qt Linguist Manual}.
59

60
    \section1 Previewing QML Files
61

62 63 64
    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.
65

66
    To preview the currently active QML file, select \gui Tools > \gui External
67 68
    > \gui {Qt Quick} > \gui {Qt Quick 1 Preview (qmlviewer)} or
    \gui {Qt Quick 2 Preview (qmlscene)}.
69 70 71 72 73 74

    \section1 Using External Text Editors

    You can open files for editing in the default text editor for your system:
    Notepad on Windows and vi on Linux and Mac OS.
    To open the file you are currently viewing in an external editor, select
75 76
    \gui Tools > \gui External > \gui Text > \gui {Edit with Notepad} or
    \gui {Edit with vi}, depending on your system.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96

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

    \section1 Sorting Text Alphabetically

    To sort selected text alphabetically, select \gui {Tools > External > Text
    > 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.

    To change the default configuration, select \gui {Tools > External >
    Configure}.

    \section1 Configuring External Tools

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

    You can use \QC variables in the fields that you can select from
97
    lists of available \QC variables (1).
98 99 100 101 102 103 104

    \image qtcreator-external-tools.png "External Tools options"

    To configure external tools:

    \list 1

105
        \li Select \gui {Tools > External > Configure}.
106

107
        \li Select \gui {Add > Add Tool}
108 109 110
            to add a new tool. You can also select \gui {Add Category} to add a
            new category.

111
        \li In the \gui Executable field, specify the executable to run. If the
112 113 114
            executable is found in your system PATH variable, do not specify
            the path to it.

115
        \li In the \gui Arguments field, specify optional arguments for running
116 117
            the executable.

118
        \li In the \gui {Working directory} field, specify the path to the
119 120
            working directory.

121
        \li In the \gui {Output pane}, select how to handle output from the
122 123 124 125
            tool. You can ignore the output, view it in the \gui {General
            Messages} output pane, or replace the selected text with the
            output in the code editor.

126
        \li In the \gui {Error output pane}, select how to handle error messages
127 128
            from the tool.

129 130 131 132
        \li Select the \gui {Modifies current document} check box to make sure
            that if the current document is modified by the tool, it is saved
            before the tool is run and reloaded after the tool finishes.

133
        \li In the \gui Input field, specify text that is passed as standard
134 135 136 137 138 139 140 141 142 143 144
            input to the tool.

    \endlist

    The category and tool are added to the \gui {Tools > External} menu.

    If you change the configuration of preconfigured tools, you can later
    revert the changes by selecting the \gui Revert button.

    The tool configurations that you add and modify are stored in XML format in
    the user configuration folder. For example,
145
    \c {~/config/QtProject/qtcreator/externaltools}
146
    on Linux and Mac OS and
147
    \c {C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools}
148 149 150 151
    in Windows. To share a configuration with other users, copy an XML
    configuration file to the folder.

*/