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

Autocomplete of inherited function ignores code formatting rule for * (pointer)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • Qt Creator 4.0.3
    • C/C++/Obj-C++ Support
    • Windows 10, Debian Jessie

    Description

      I have set my C/C++ formatting for pointers with the checkboxes `type name` and `left const/volatile` checked while the other two (`identifier` and `right const/volatile`) unchecked inside my custom code style in the section Pointers and References. This results in the alignment

      int* myPtr = ...;
      

      for the `*` operator when it comes to pointers. However whenever I inherit from a Qt-class the formatting is the default one that is

      int *myPtr = ...;
      

      For example if I inherit

      QObject::event(QEvent *event)
      

      I will get exactly that instead of a signature which is compliant with the one set by the code style I am currently using that is

      QObject::event(QEvent* event)
      

      This issue probably is not restricted to Qt's own classes/functions. Basically it seems that Qt Creator takes whatever the signature is (in terms of formatting, content-wise it obviously has to remain the same) and pastes it completely disregarding my settings.

      While using the beautifier can correct this issue by simply running it (if the plugin has been enabled and if a style has been set for the respective project that the beautifier can use), it's an issue and as such needs to be addressed. Manually re-formatting the code is another option but needless to say it is pretty tedious to do every time you use the autocomplete feature. This is of course a minor issue but if the company you work for has coding conventions you might want to stick to those.

      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
              rbaleksandar Red Baron
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes