Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Autocompletion doesn't suggest function parameters inherited from parent class
QtWS25 Last Chance

Autocompletion doesn't suggest function parameters inherited from parent class

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maxxii
    wrote on last edited by
    #1

    I reported this as a bug here, but now I began to doubt, if I am doing everything properly.
    Detailed description of this behavior is by the link above on Qt bugtracker, but to be short: when I'm trying to declare function in my class with the same name as the function in inherited class, I'm expecting editor to suggest (to autocomplete) same parameters as function in parent class have. This is how it was in some previous version of Qt:

    0_1555178123049_old.png

    And this is how it is in current version:

    0_1555178152444_new.jpg

    I am not very experienced in C++/Qt, and maybe this way of doing things is deprecated or something like that, and in current version of Qt I should do it differently. I just wanted to be sure it's a bug, and not me doing it incorrectly.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      They changed the autocompletion feature and as a result its a bit different from older Creators.
      Did you try to disable the code model plugin and see if that makes a difference?

      https://forum.qt.io/topic/100762/qt-creator-clang-code-model-problems-collection

      1 Reply Last reply
      3
      • M Offline
        M Offline
        Maxxii
        wrote on last edited by Maxxii
        #3

        Yes, it is working as expected with that plugin turned off. I will leave a comment in that topic about this behaviour. Thank you!

        1 Reply Last reply
        1
        • M Offline
          M Offline
          Maxxii
          wrote on last edited by Maxxii
          #4

          I found some more things about this bug and added it in "update" section in my bug report, but for reference, in case somebody else will be interested in this in future, I will leave it here as well:

          Update: just noticed, that editor doesn't autocomplete even the name of the function (setEditorData), so that could be the reason.

          Also, with Clang Code Model turned off, when it autocompletes the name of the function (setEditorData), it automatically inserts parenthesis semicolon, but NOT autocomplete parameters. But if you delete this auto-inserted symbols - (); - and type parenthesis by yourself - only then editor will suggest auto-completion for parameters.

          Also, I found a proper way when everything works as expected (auto-completing name of the function and auto-inserting parameters even without disabling Clang Code Model) - use full name for the function, with the name of the class, like this - Delegate::setEditorData.

          But I suppose it should work even without it, because standard included example "Spin Box Delegate Example" isn't using full name for the function declaration, and, as it shown in attached screenshot - it used to work before.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved