// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page creator-preferences-qtquick-code-style.html
    \if defined(qtdesignstudio)
    \previouspage qtquick-text-editor.html
    \else
    \previouspage creator-how-tos.html
    \endif

    \ingroup creator-how-to-edit
    \ingroup studio-how-to-code

    \title Specify Qt Quick code style

    You can use the built-in code formatter (deprecated) or an external tool,
    such as \l {qmlformat}, to automatically format QML files according to QML
    coding conventions.

    To specify QML code style globally:

    \list 1
        \li Go to \preferences > \uicontrol {Qt Quick} > \uicontrol {Code Style}.
        \li In \uicontrol {Custom settings}, select the settings to
            modify, and then select \uicontrol Copy.
            \image {qtcreator-preferences-qtquick-code-style.webp} {Code Style tab in Qt Quick preferences}
        \li Give a name to the settings, and select \uicontrol OK.
        \li In \uicontrol {Formatter Selection}, select the formatter to use.
        \li For the built-in formatter, specify how to interpret the \key Tab key
            presses and how to align continuation lines, as well as set the
            maximum line length for code lines.
    \endlist

    To override the global preferences for a particular project, select
    \uicontrol Projects > \uicontrol {Code Style}.

    \section1 Qmlformat global configuration

    When you select \l {qmlformat} as the formatter, you can configure it globally
    by editing the \uicontrol {Qmlformat global configuration} field. This field uses
    the same format as a \c .qmlformat.ini file and overrides the \c .qmlformat.ini
    file in the generic configuration location (\l{QStandardPaths::GenericConfigLocation}).

    The \l {qmlformat} tool searches for a \c .qmlformat.ini file in the same directory as the
    file being formatted. If it is not found, it searches the parent directories up to
    the root directory. If no \c .qmlformat.ini file is found, the global configuration
    is used. For information about configuring QML formatting options, see the
    \l{qtqml-tooling-qmlformat.html#qmlformat-settings}{qmlformat configuration settings}.

    \note If a custom \c .qmlformat.ini file exists in the project directory or any
    parent directory, it takes precedence over the global configuration.

    \sa {Automatically format QML/JS files}, {Indent text or code}

    \if defined(qtcreator)
    \sa {Find preferences}, {Specify code style}
    \endif
*/
