Nominate our 2022 Qt Champions!

External code beautifier / custom indentation .

  • It's possible to use an external third part program to format the code in QtCreator ? If yes, how ?

  • Hi,

    you can use the new Beautifier plugin if you want to use Clang-format, Uncrustify or Artistic Style. Other tools can only be invoked by a "External Tool" (see settings -> environment).

    What code beautifier you are like to use?


  • Thanks but I can't see the point of that plugin, it's not giving me automatic indentation, there is not shortcut to it, and it's basically yet another menu option.

    I was hoping for something more pragmatic and viable.

  • Automatic indention: No, but that isn't the purpose of source beautifiers.
    As for the shortcut: options -> environment -> keyboard
    Main benefit: the beautified code is fully integrated into the undo framework and can be called on unsaved files. (In opposite to calling external tools.)

    Normally I write my code, living with the auto indent provided by Qt, and then trigger my short cut quite often. So all other styles, I set up, get respected. Works for me.

Log in to reply