Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 6.0.1
Description
Qt Creator starts to wrong the auto-indentation of the code after a variable initialization that uses curly brackets init with the conditional operator.
An example below
#include <iostream> #include <QString> int main(int argc, char *argv[]) { int var1 = -24, var2 = 5774; auto longer { QString::number(var1 ).size() >= QString::number(var2).size() ? &var1 : &var2 }; std::cout << "The int with more chars is " << *longer << std::endl; }
If I select the whole text and I auto-indent the code the result is:
#include <iostream> #include <QString> int main(int argc, char *argv[]) { int var1 = -24, secondInt = 5774; auto longer { QString::number(var1 ).size() >= QString::number(var2).size() ? &var1 : &var2 }; // Starting from now the indentation is wrong std::cout << "The int with more chars is " << *longer << std::endl; }