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

Formatting while using "Refactor" -> "Add definition in .cpp"

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • Qt Creator 2.7.0
    • Qt Creator 2.5.0-beta
    • C/C++/Obj-C++ Support
    • None

      Source formatting is not preserved while using alternative (not like as Qt) code style.

      For example we have some member in some .h file:

      Test.h
      const std::string& TestFn(const std::string& str);
      

      "Refactor" -> "Add definition in .cpp" will produce:

      Test.cpp
      const std::string &Process::TestFn(const std::string &str)
      {
      }
      

      I.e. ampersands are in wrong places - not the same as in header.
      It should be like that:

      TestRight.cpp
      const std::string& Process::TestFn(const std::string& str)
      {
      }
      

      The same thing with asterisks.

      I think place of ampersands and asterisks should be controlled via "Options" -> "C++" -> "Code Style", not hardcoded.

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

            kosjar Nikolai Kosjar
            loentar Dmitry Utkin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes