Specify Qt Quick code style
You can use the built-in code formatter (deprecated) or an external tool, such as qmlformat, to automatically format QML files according to QML coding conventions.
To specify QML code style globally:
- Go to Preferences > Qt Quick > Code Style.
- In Custom settings, select the settings to modify, and then select Copy.
- Give a name to the settings, and select OK.
- In Formatter Selection, select the formatter to use.
- For the built-in formatter, specify how to interpret the Tab key presses and how to align continuation lines, as well as set the maximum line length for code lines.
To override the global preferences for a particular project, select Projects > Code Style.
See also Automatically format QML/JS files, Indent text or code, Find preferences, and Specify code style.