Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-19158

Unable to enforce usage of const specifier on right in generated code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • Qt Creator 12.0.0
    • Qt Creator 4.5.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • MacOS High Sierra 10.13
    • 9f6878dda (master)

    Description

      The coding style I use prefers const specifier on the right. So, instead of writing:

      const MyClass * c;
      

      I would write:

      MyClass const * c;
      

      The QtCreator currently does not allow specifying desired location of const specifier for generated code. Even worse, it does not even follow the original declaration when generating implementation in cpp file, which is very annoying.

      For example, if I write this in my header file:

      void doSomething( MyClass const & cl );
      

      and invoke generated implementation in cpp file option, the generated code in cpp file would be

      void doSomething(const MyClass & cl)
      {
      }

      As you can see, both const specifier is on the wrong side and spaces inside braces are missing. This gets very annoying when having lots of function parameters. Can you please add those code formatting options?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              dodoent Nenad Miksa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes