diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-01-15 14:26:24 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-01-24 11:59:40 +0100 |
commit | 8fe25d0a4a1f61d0071ff9f10bb26204354da58e (patch) | |
tree | 8d5ee9a7e62d35d55f8a3ada86e102a7905e7202 /src/plugins/cpptools/cppcodestylesettings.h | |
parent | 138066792e61925b827d9d722669b8d96bc0a87b (diff) | |
download | qt-creator-8fe25d0a4a1f61d0071ff9f10bb26204354da58e.tar.gz |
C++: Add settings dialog for pointer declaration formatting
The dialog is at Tools > Options > C++ > Code Style > Edit... > Pointers
and References.
Currently the settings are referenced when applying the following
QuickFixes:
- Adapting function signature in declaration/definition
(FunctionDeclDefLink)
- Inserting declaration from definition (InsertDeclOperation)
- Inserting definition from declaration (InsertDefOperation)
- Extracting a function (ExtractFunctionOperation)
- Add Local Declaration (AddLocalDeclarationOp::Operation)
In these cases the code style of the current project is used. If there
is no current project open, the current global code style is used.
Task-number: QTCREATORBUG-6169
Change-Id: I3e4e502b3103f7f754ac9b39594ad461d89d9304
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodestylesettings.h')
-rw-r--r-- | src/plugins/cpptools/cppcodestylesettings.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodestylesettings.h b/src/plugins/cpptools/cppcodestylesettings.h index c2cb18d910..664ee29503 100644 --- a/src/plugins/cpptools/cppcodestylesettings.h +++ b/src/plugins/cpptools/cppcodestylesettings.h @@ -32,6 +32,8 @@ #include "cpptools_global.h" +#include <cplusplus/Overview.h> + #include <QMetaType> #include <QVariant> @@ -61,6 +63,12 @@ public: bool indentBlocksRelativeToSwitchLabels; bool indentControlFlowRelativeToSwitchLabels; + // Formatting of pointer and reference declarations, see Overview::StarBindFlag. + bool bindStarToIdentifier; + bool bindStarToTypeName; + bool bindStarToLeftSpecifier; + bool bindStarToRightSpecifier; + // false: if (a && // b) // c; @@ -87,6 +95,21 @@ public: bool equals(const CppCodeStyleSettings &rhs) const; bool operator==(const CppCodeStyleSettings &s) const { return equals(s); } bool operator!=(const CppCodeStyleSettings &s) const { return !equals(s); } + + /*! Returns an Overview configured by the current project's code style. + + If no current project is available or an error occurs when getting the + current project's code style, the current global code style settings + are applied. + */ + static CPlusPlus::Overview currentProjectCodeStyleOverview(); + + /*! Returns an Overview configured by the current global code style. + + If there occurred an error getting the current global code style, a + default constructed Overview is returned. + */ + static CPlusPlus::Overview currentGlobalCodeStyleOverview(); }; } // namespace CppTools |