Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
Qt Creator 11.0.3
-
None
-
windows 10, PC
Description
i just installed qt 6.6.0 and qt creator 11.0.3 (community), i uninstalled my old qt and creator before installing this one.
i now have a problem with the automatic indenting feature. it's creating an alternating pattern for all my indents like this:
private:
int var1; //2 spaces
int var2; //4 spaces
int var3; //2 spaces
int var4; //4 spaces
the default settings are supposed to create a consistent indent of 4 spaces.
there is a preview pane in: Preferences > C++ > ClangFormat tab.
typing the variables into the preview pane correctly indents with 4 spaces.
i do believe that all of my settings and preferences for qt creator are at the defaults because i deleted everything in %APPDATA%\QtProject
my settings are:
Edit > Preferences > C++ > Clangformat settings:
Formatting mode: Indenting only.
Current settings: Qt [built-in]
i have found that the problem goes away if you go to Preferences>C++>CodeStyle, and click the "Copy..." button to make a duplicate of the current settings, then change the BasedOnStyle to Microsoft.
i suspect that the default "Qt [built-in]" settings are broken, since making a copy of the settings and changing the BasedOnStyle fixes the problem.
the problem also goes away if i completely disable formatting with "Formatting mode: Disable."
steps to reproduce the problem are simply do a full clean install on a window10 PC and try making some variables as shown in a "QT widgets application" project. all of my settings are 100% the defaults as far as i know.