2011-09-27 11:55:44 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator
|
2011-09-27 11:55:44 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of this
|
|
|
|
|
** file.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
// 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.
|
|
|
|
|
// **********************************************************************
|
|
|
|
|
|
|
|
|
|
/*!
|
2014-03-17 12:18:12 +01:00
|
|
|
\contentspage {Qt Creator Manual}
|
2011-09-27 11:55:44 +02:00
|
|
|
\previouspage creator-editor-settings.html
|
|
|
|
|
\page creator-code-style-settings.html
|
|
|
|
|
\nextpage creator-build-dependencies.html
|
|
|
|
|
|
|
|
|
|
\title Specifying Code Style Settings
|
|
|
|
|
|
|
|
|
|
\QC uses the \l{Editing MIME Types}{MIME type} of the file to
|
|
|
|
|
determine which mode and editor to use for opening the file.
|
2014-12-11 15:43:19 +01:00
|
|
|
\QC opens C++ files in \uicontrol Edit mode in the C++ code editor and
|
2011-09-27 11:55:44 +02:00
|
|
|
QML files in the Qt Quick editor.
|
|
|
|
|
|
|
|
|
|
You can configure the code style according to your needs. You can specify
|
|
|
|
|
code style either globally for all projects or separately for each
|
2011-10-10 17:12:42 +02:00
|
|
|
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.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2011-10-10 17:12:42 +02:00
|
|
|
To specify global code style settings sets for C++ files, select
|
2014-12-11 15:43:19 +01:00
|
|
|
\uicontrol {Tools > Options > C++}.
|
2011-10-10 17:12:42 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
To specify global code style settings sets for QML files, select \uicontrol {Tools
|
2011-10-10 17:12:42 +02:00
|
|
|
> Options > Qt Quick}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
To configure the editor behavior for the current project:
|
|
|
|
|
|
2011-11-08 16:55:05 +01:00
|
|
|
\list 1
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select \uicontrol Projects > \uicontrol {Code Style}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol Language field, select \uicontrol C++ or \uicontrol {Qt Quick}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li In the \uicontrol {Current settings} field, select the settings to modify
|
|
|
|
|
and click \uicontrol Copy.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Give a name to the settings and click \uicontrol OK.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Click \uicontrol Edit to specify code style settings for the project.
|
2011-10-10 17:12:42 +02:00
|
|
|
|
|
|
|
|
\image qtcreator-code-style-settings-edit-cpp.png "Edit Code Style Settings dialog"
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\note Only \uicontrol General settings are available for QML files.
|
2011-10-10 17:12:42 +02:00
|
|
|
|
|
|
|
|
\image qtcreator-code-style-settings-edit-qtquick.png "Edit Code Style Settings view"
|
|
|
|
|
|
|
|
|
|
\endlist
|
2011-09-27 11:55:44 +02:00
|
|
|
|
2013-04-05 10:55:53 +02:00
|
|
|
For more information about the settings, see \l{Indenting Text or Code}.
|
2011-09-27 11:55:44 +02:00
|
|
|
|
|
|
|
|
*/
|