2011-09-27 11:53:38 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2021-01-13 10:59:37 +01:00
|
|
|
** Copyright (C) 2021 The Qt Company Ltd.
|
2016-01-15 14:51:16 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-09-27 11:53:38 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** This file is part of the Qt Creator documentation.
|
2011-09-27 11:53:38 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** 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.
|
2011-09-27 11:53:38 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** GNU Free Documentation License Usage
|
2011-09-27 11:53:38 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
2016-01-15 14:51:16 +01:00
|
|
|
** 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.
|
2011-09-27 11:53:38 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// 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.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\page creator-editor-external.html
|
2019-11-15 15:30:06 +01:00
|
|
|
\if defined(qtdesignstudio)
|
|
|
|
|
\previouspage creator-qml-performance-monitor.html
|
2020-11-30 15:51:29 +02:00
|
|
|
\nextpage creator-telemetry.html
|
2019-11-15 15:30:06 +01:00
|
|
|
\else
|
|
|
|
|
\previouspage creator-keyboard-shortcuts.html
|
2011-12-13 11:52:47 +01:00
|
|
|
\nextpage creator-task-lists.html
|
2019-11-15 15:30:06 +01:00
|
|
|
\endif
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
\title Using External Tools
|
|
|
|
|
|
2017-11-01 13:10:26 +01:00
|
|
|
You can use external tools directly from \QC. Qt Linguist, QML preview
|
|
|
|
|
tools, and the default text editor for your system are preconfigured
|
2011-09-27 11:53:38 +02:00
|
|
|
for use. You can change their default configurations and configure new
|
|
|
|
|
tools.
|
|
|
|
|
|
2015-07-10 10:34:14 +02:00
|
|
|
To run the tools, select \uicontrol Tools > \uicontrol External, or use the
|
|
|
|
|
\c x filter in the locator.
|
|
|
|
|
|
2011-09-27 11:53:38 +02:00
|
|
|
\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.
|
|
|
|
|
|
2019-09-23 15:52:09 +02:00
|
|
|
When you \l{Creating Projects}{create a new project}, you can automatically
|
|
|
|
|
generate a translation source file (TS) for one language. You can add other
|
|
|
|
|
languages later by editing the project file.
|
|
|
|
|
|
|
|
|
|
To synchronize TS files from a translator with the
|
2019-02-25 14:05:46 +01:00
|
|
|
application code, select \uicontrol Tools > \uicontrol External >
|
|
|
|
|
\uicontrol Linguist > \uicontrol {Update Translations (lupdate)}.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2014-07-23 13:36:19 +02:00
|
|
|
To generate from the TS files Qt message (QM) files that can be used by an
|
2019-02-25 14:05:46 +01:00
|
|
|
application, select \uicontrol Tools > \uicontrol External >
|
|
|
|
|
\uicontrol Linguist > \uicontrol {Release Translations (lrelease)}.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
By default, the project .pro file is passed to the tools as an argument. To
|
2020-04-02 11:46:41 +02:00
|
|
|
specify other command line arguments for the tools, select \uicontrol Tools >
|
2021-01-13 10:59:37 +01:00
|
|
|
\uicontrol External > \uicontrol Configure.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2016-11-02 09:14:13 +01:00
|
|
|
To open TS files in Qt Linguist, right-click a TS file in the
|
2019-11-15 15:30:06 +01:00
|
|
|
\uicontrol Projects or \uicontrol {File System} view and select
|
|
|
|
|
\uicontrol {Open With} > \uicontrol {Qt Linguist} in the context menu.
|
2013-11-25 17:37:19 +01:00
|
|
|
For more information about Qt Linguist, see \l{Qt Linguist Manual}.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2012-11-20 10:54:32 +01:00
|
|
|
\section1 Previewing QML Files
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2012-11-20 10:54:32 +01:00
|
|
|
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.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
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)}.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
\section1 Using External Text Editors
|
|
|
|
|
|
|
|
|
|
You can open files for editing in the default text editor for your system:
|
2016-08-03 16:46:29 +02:00
|
|
|
Notepad on Windows and vi on Linux and \macos.
|
2011-09-27 11:53:38 +02:00
|
|
|
To open the file you are currently viewing in an external editor, select
|
2014-12-11 15:43:19 +01:00
|
|
|
\uicontrol Tools > \uicontrol External > \uicontrol Text >
|
|
|
|
|
\uicontrol {Edit with Notepad} or \uicontrol {Edit with vi}, depending on
|
|
|
|
|
your system.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
\QC looks for the editor path in the PATH environment variable
|
|
|
|
|
of your operating system.
|
|
|
|
|
|
|
|
|
|
\section1 Configuring External Tools
|
|
|
|
|
|
|
|
|
|
You can change the configuration of preconfigured tools and configure
|
2014-12-11 15:43:19 +01:00
|
|
|
additional tools in \QC \uicontrol Options.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2015-03-24 16:40:55 +01:00
|
|
|
\image qtcreator-external-tools.png
|
|
|
|
|
|
2021-01-13 10:59:37 +01:00
|
|
|
Select the \inlineimage replace.png
|
|
|
|
|
(\uicontrol {Variables}) button in a field to select from a list of
|
|
|
|
|
\l{Using Qt Creator Variables}{variables} that are available in a
|
|
|
|
|
particular context.
|
|
|
|
|
|
2011-09-27 11:53:38 +02:00
|
|
|
To configure external tools:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2020-04-02 11:46:41 +02:00
|
|
|
\li Select \uicontrol Tools > \uicontrol External >
|
|
|
|
|
\uicontrol Configure.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2020-04-02 11:46:41 +02:00
|
|
|
\li Select \uicontrol Add > \uicontrol {Add Tool}
|
2014-12-11 15:43:19 +01:00
|
|
|
to add a new tool. You can also select \uicontrol {Add Category} to add a
|
2011-09-27 11:53:38 +02:00
|
|
|
new category.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol Executable field, specify the executable to run. If the
|
2011-09-27 11:53:38 +02:00
|
|
|
executable is found in your system PATH variable, do not specify
|
|
|
|
|
the path to it.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol Arguments field, specify optional arguments for running
|
2011-09-27 11:53:38 +02:00
|
|
|
the executable.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol {Working directory} field, specify the path to the
|
2011-09-27 11:53:38 +02:00
|
|
|
working directory.
|
|
|
|
|
|
2015-03-24 16:40:55 +01:00
|
|
|
\li In the \uicontrol Output field, select how to handle output from the
|
2014-12-11 15:43:19 +01:00
|
|
|
tool. You can ignore the output, view it in the \uicontrol {General
|
2011-09-27 11:53:38 +02:00
|
|
|
Messages} output pane, or replace the selected text with the
|
|
|
|
|
output in the code editor.
|
|
|
|
|
|
2015-03-24 16:40:55 +01:00
|
|
|
\li In the \uicontrol {Error output} field, select how to handle error
|
|
|
|
|
messages from the tool.
|
|
|
|
|
|
2019-11-15 15:57:40 +01:00
|
|
|
\if defined(qtcreator)
|
2019-02-25 14:05:46 +01:00
|
|
|
\li In the \uicontrol {Base environment} field, select whether to run
|
|
|
|
|
the tool in the system environment or the \l{Build Environment}
|
|
|
|
|
{build environment} or \l {Selecting the Run Environment}
|
|
|
|
|
{run environment} of the active project. Select the build or run
|
|
|
|
|
environment if the system environment does not contain the necessary
|
|
|
|
|
PATH settings to find the tool chain, for example.
|
2019-11-15 15:57:40 +01:00
|
|
|
\else
|
|
|
|
|
\li In the \uicontrol {Base environment} field, use the default settings.
|
|
|
|
|
\endif
|
2019-02-25 14:05:46 +01:00
|
|
|
|
2015-03-24 16:40:55 +01:00
|
|
|
\li In the \uicontrol Environment field, select \uicontrol Change to modify
|
|
|
|
|
environment variable values for build and run environments in
|
2019-11-15 15:57:40 +01:00
|
|
|
the \uicontrol {Edit Environment Changes} dialog.
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
For more information about how to add and remove variable values,
|
|
|
|
|
see \l{Batch Editing}.
|
|
|
|
|
\endif
|
2011-09-27 11:53:38 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select the \uicontrol {Modifies current document} check box to make sure
|
2013-11-22 11:56:39 +01:00
|
|
|
that if the current document is modified by the tool, it is saved
|
|
|
|
|
before the tool is run and reloaded after the tool finishes.
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol Input field, specify text that is passed as standard
|
2011-09-27 11:53:38 +02:00
|
|
|
input to the tool.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
2020-04-02 11:46:41 +02:00
|
|
|
The category and tool are added to the \uicontrol Tools >
|
|
|
|
|
\uicontrol External menu.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
If you change the configuration of preconfigured tools, you can later
|
2015-03-24 16:40:55 +01:00
|
|
|
revert the changes by selecting the \uicontrol Reset button.
|
2011-09-27 11:53:38 +02:00
|
|
|
|
|
|
|
|
The tool configurations that you add and modify are stored in XML format in
|
|
|
|
|
the user configuration folder. For example,
|
2012-10-09 12:21:04 +02:00
|
|
|
\c {~/config/QtProject/qtcreator/externaltools}
|
2016-08-03 16:46:29 +02:00
|
|
|
on Linux and \macos and
|
2012-10-09 12:21:04 +02:00
|
|
|
\c {C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools}
|
2011-09-27 11:53:38 +02:00
|
|
|
in Windows. To share a configuration with other users, copy an XML
|
|
|
|
|
configuration file to the folder.
|
|
|
|
|
|
|
|
|
|
*/
|