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

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.5.0-beta1
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      MacOS High Sierra 10.13

      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

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

          Activity

            People

            • Assignee:
              kosjar Nikolai Kosjar
              Reporter:
              dodoent Nenad Miksa
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes