Chaofeng Wang

Computational Mechanics, Natural Hazards, Decarbonization, Construction Automation

8 years ago in C++, Qt, blog · 0 MIN READ

Auto-formatting C++ code using AStyle in Qt Creator's Beautifier Plugin

Today I find my code does not looks good in Qt Creator. So I installed AStyle to use it with the beautifier plugin.

  1. download AStyle here http://astyle.sourceforge.net/
  2. cd astyle/build/mac & make // executable will be generated in bin floder
  3. go to Qt Creator -> Preferences -> Beautifier -> Artistic Style put the address of the generated executable in Artistic Style command
  4. specify a style in options.
  5. Qt Creator -> Tools -> Beautifier -> Artistic Style -> Format Current File

It works great.

···

Chaofeng Wang



© 2024 Chaofeng Wang ยท Built on Canvas / Laravel