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

// **********************************************************************
// 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-code-style-settings.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-configure-editors

    \title Specify code style

    The MIME type of the file determines which mode
    and editor the file opens in. \QC opens C++ files in \uicontrol Edit mode
    in the C++ code editor and QML files in the Qt Quick editor.

    Specify indentation for:

    \list
        \li C++ files
        \li QML files
        \li Nim files
    \endlist

    Specify code style either globally or separately for each project.
    You can specify several sets of code style settings and easily switch between
    them. In addition, you can import and export code style settings.

    To override the global code style for the current project:

    \list 1

        \li Go to \uicontrol Projects > \uicontrol {Project Settings} >
            \uicontrol {Code Style}.

            \image {qtcreator-code-style-clang-format-project.webp} {Code Style settings in the Projects mode}

        \li In \uicontrol Language, select \uicontrol C++,
            \uicontrol {Qt Quick}, or \uicontrol Nim.

        \li For C++, clear \uicontrol {Use global settings} to use the
            \c {.clang-format} file for the project.

        \li To override the project's \c {.clang-format} file,
            select \uicontrol {Use custom settings}.

        \li In \uicontrol {Custom settings}, select the settings to use for the
            project.
    \endlist

    In rare cases, \l{ClangFormat: Documentation}{ClangFormat} can trip over a
    code construct and trigger a \QC crash. If that happens for your project,
    select \uicontrol {Use Built-In Indenter} in \uicontrol {Formatting mode} to
    turn off ClangFormat for the project. If you can reproduce the crash,
    go to \uicontrol Help > \uicontrol {Report Bug} to report
    the bug and attach the code that triggers the crash to the bug report.

    \sa {Indent text or code}, {Edit MIME types}, {C++ Code Style},
    {Qt Quick Code Style}, {Nim}
*/
