Doc: Select the tool to automatically format QML files

For example, qmlformat.

Task-number: QTCREATORBUG-28721
Change-Id: I509cba3fd842f94e7656a3356cc1de81e41fd8e2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Leena Miettinen
2023-02-22 16:57:00 +01:00
parent 3d8b46685a
commit a8e424f75e
4 changed files with 10 additions and 2 deletions

View File

@@ -729,8 +729,16 @@
To automatically format QML/JS files upon saving, select \uicontrol Edit >
\uicontrol Preferences > \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} >
\uicontrol {Enable auto format on file save}.
To only format files that belong to the current project, select
\uicontrol {Restrict to files contained in the current project}.
\image qtcreator-qml-js-editing.png "QML/JS Editing preferences"
To use an external tool, such as \l {qmlformat}, which automatically
formats QML files according to QML coding conventions, select
\uicontrol {Use custom command instead of built-in formatter}. In
the \uicontrol Command field, enter the path to the tool. In the
\uicontrol Arguments field, enter options for running the tool.
\image qtcreator-qml-js-editing.webp {QML/JS Editing preferences}
\if defined(qtcreator)
\section1 Inspecting Preprocessed C++ Code