Uploaded image for project: 'Qt Creator'
  1. Qt Creator

No proper completion of declarations/overrides



    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.8.2
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
    • Environment:
      Windows 10 x64


      (I'm using example from my previously reported bug, just because I can use screenshot from there to demonstrate expected behavior. I tried to reproduce "Spin Box Delegate Example" from standard examples)

      Steps to reproduce: 

      1. Create new Qt Widget Application
      2. Add new C++ class (named Delegate, for example), with Base Class: QObject
      3. In the header file of this class Include QItemDelegate
      4. Change inheritance of this class from QObject to QItemDelegate
      5. In "public:" section start typing "QWidget *createEditor("  – or copy completed version of this string from attached code and try typing next string "void setEditorData("

      Expected behavior:

      Editor will suggest default parameters, inherited from parent class as auto-completion (see  screenshot "old.png")

      Actual behavior:

      It will ignore inherited parameters from parent class and show regular suggestions as auto-completion (see screenshot "new.jpg")


      #ifndef DELEGATE_H
      #define DELEGATE_H
      #include <QObject>
      #include <QItemDelegate>
      class Delegate : public QItemDelegate
          explicit Delegate(QObject *parent = nullptr);
          QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
          void setEditorData(
      public slots:
      #endif // DELEGATE_H


      Additional info:

      Partly (see update section below) solving by deactivating the Clang Code Model with Help > About Plugins > Clang Code Model



      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. new.jpg
          56 kB
        2. old.png
          17 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            • Assignee:
              kosjar Nikolai Kosjar
              maxxii Maksim Piontkovskiy
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes