// Copyright (C) 2023 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-edit

    \title Specify code style

    The \l{Editing MIME Types}{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.

    You can specify indentation for:

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

    You can 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 Select \uicontrol Projects > \uicontrol {Project Settings} >
            \uicontrol {Code Style}.

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

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

        \li Deselect the \uicontrol {Use global settings} check box.

        \li In the \uicontrol {Current settings} field, select the settings to modify
            and click \uicontrol Copy.

        \li Give a name to the settings and click \uicontrol OK.

        \li Click \uicontrol Edit to specify a code style for the project.

    \endlist

    In rare cases, ClangFormat can trip over a code construct and
    trigger a \QC crash. If that happens for your project, select
    \uicontrol Disable as the formatting mode to switch
    ClangFormat off for the project. If you can reproduce the crash,
    please select \uicontrol Help > \uicontrol {Report Bug} to report
    the bug and and attach the code that triggers the crash.

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