[Qt-creator] Formatting of "using" with structs

André Pönitz apoenitz at t-online.de
Sat Oct 20 11:40:36 CEST 2018


On Fri, Oct 19, 2018 at 06:50:57AM -0400, Andy wrote:
> I've been updating some of my code from "typedef" to "using" style:
> 
>    typedef int foo;
> 
>    using foo = int;
> 
> 
> When I try it with structs though the formatting gets all messed up in
> Creator:
> 
>    using FooInfo = struct
> 
>    {
>    QString  name;
>    QString  code;
> 
> };


Given that this is C++, not C, the canonical way to write this would be

    struct FooInfo
    {
        QString  name;
        QString  code;
    };

i.e. neither typedef nor using.

Andre'



More information about the Qt-creator mailing list