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

Refactor | Add public declaration: add the override keyword when appropriate

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Won't Do
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • C/C++/Obj-C++ Support
    • None

      Let's say I'm creating a QAIM subclass. In my .cpp file I start typing the signature of the data() function:

      In older versions of Creator I think it used to fill in the arguments when I select the right one; now it doesn't. So that's a separate bug. Anyway... I resorted to copying the function signature from docs and then replacing the class name. Then select Refactor | Add public declaration:

      It does that, but I immediately get the clazy warning that it overrides a virtual function without declaring the override:

      so it seems like that's something the code model could have detected, and added the override keyword.

        1. image-2023-03-21-09-04-22-616.png
          162 kB
          Shawn Rutledge
        2. image-2023-03-21-09-07-20-891.png
          194 kB
          Shawn Rutledge
        3. image-2023-03-21-09-08-31-034.png
          135 kB
          Shawn Rutledge
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kandeler Christian Kandeler
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes