You can use external tools directly from Qt Creator. Qt Linguist, QML preview tools, and the default text editor for your system are preconfigured for use. You can change their default configurations and configure new tools.
To run the tools, select
工具
>
External
, or use the
x
filter in the locator.
You can use the Qt Linguist release manager tools, lupdate and lrelease, directly from Qt Creator. 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.
When you 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 application code, select 工具 > External > Linguist > Update Translations (lupdate) .
To generate from the TS files Qt message (QM) files that can be used by an application, select 工具 > External > 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 工具 > External > 配置 .
To open TS files in Qt Linguist, right-click a TS file in the Projects or File System view and select Open With > Qt Linguist in the context menu. For more information about Qt Linguist, see Qt Linguist 手册 .
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.
To preview the currently active QML file, select 工具 > External > Qt Quick > Qt Quick 1 Preview (qmlviewer) or Qt Quick 2 Preview (qmlscene) .
You can open files for editing in the default text editor for your system: Notepad on Windows and vi on Linux and macOS. To open the file you are currently viewing in an external editor, select 工具 > External > Text > Edit with Notepad or Edit with vi , depending on your system.
Qt Creator looks for the editor path in the PATH environment variable of your operating system.
You can change the configuration of preconfigured tools and configure additional tools in Qt Creator Options .
Select the
(
变量
) button in a field to select from a list of
variables
that are available in a particular context.
To configure external tools:
The category and tool are added to the 工具 > External 菜单。
If you change the configuration of preconfigured tools, you can later revert the changes by selecting the Reset button.
The tool configurations that you add and modify are stored in XML format in the user configuration folder. For example,
~/config/QtProject/qtcreator/externaltools
on Linux and macOS and
C:\Users\username\AppData\Roaming\QtProject\qtcreator\externaltools
in Windows. To share a configuration with other users, copy an XML configuration file to the folder.