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

Allow user to define codestyle for const placement

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • Qt Creator 3.0.1
    • C/C++/Obj-C++ Support
    • None

    Description

      Currently the coding style is fixed and might not match the one desired by the user.

      The following code brings up two ways this could be improved:

      void myMethod(QString const * s);
      
      • Refactoring brings up an option to reformat to const QString * s, but the other way around might be more relevant if your coding style is to put const keywords after the type, however it is not possible. As a side note, this option is not brought up by QString const s, although one could expect it to.
      • Using one of the Refactor/Add definition options will generate the following code, regardless of the coding style used in the method declaration. See Bug report 11439 on that issue.
        void MyClass::myMethod(const QString * s)
        {
        }
        

      This doesn't sound like too complicated an addition, as there are already options for coding style relative to spacing around const keywords, and the refactor option already exists.

      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
              khaur Khaur
              Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes