Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT Creator not showing autocomplete for C++ methods
QtWS25 Last Chance

QT Creator not showing autocomplete for C++ methods

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 4 Posters 345 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.
  • J Offline
    J Offline
    Josko
    wrote on last edited by Josko
    #1

    Hello!
    I have QT Creator 14.0.1.

    Regardless if I choose plain C++ or QT app, code completion does not work for pure C++ methods, e.g. from std:: .
    In the screenshot example: I have created clean plain C++ app and trying to get <string>.length().
    For QT stuff works OK.
    As you can see: under Preferences->Text Editor->Completion the character threshold was attempted to be set to various values.
    Thanks!!

    SCREENSHOT.jpg

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Josko
      wrote on last edited by Josko
      #6

      I have upgraded my QT to 6.7.3 so as MSVC from 2019 to 2022 so as installed MinGW but these only partially solved the problem (std::vector started to autocomplete but std::string not).
      But found out what made autocomplete to work fully: checking the box Use clangd in Clangd tab under Preferences -> C++ .
      Seems it has to be done with every new project.

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

        Hi @Josko,

        Can you actually compile (and run) this test program?

        It seems you are using Windows, please tell us which compiler and which Qt version you are using (see in the Kits settings).

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Josko
          wrote on last edited by Josko
          #3

          Hi!
          Compiler is MSVC2019, QT 6.7.2 .
          Yes, after I manually complete str.length() not just that I can compile and run but I see correct value of length() property in debugger.
          Same was the case when I tried with other pure C++ functions like e.g. those included in <vector> namespace.

          Screenshot.jpg

          emman_fosuE 1 Reply Last reply
          0
          • J Josko

            Hi!
            Compiler is MSVC2019, QT 6.7.2 .
            Yes, after I manually complete str.length() not just that I can compile and run but I see correct value of length() property in debugger.
            Same was the case when I tried with other pure C++ functions like e.g. those included in <vector> namespace.

            Screenshot.jpg

            emman_fosuE Offline
            emman_fosuE Offline
            emman_fosu
            wrote on last edited by
            #4

            @Josko It is surprising the program compiles but does not autocomplete.
            Try to change the compiler if it will work. I am currently on Qt Creator 15.00 and Qt 6.8 using the MinGW x86 64-bit compiler that comes bundled with Qt and it works here.

            You can change the compiler settings by going to Edit > preferences > Kits
            This is a screenshot of the compiler tab of Kits.
            Screenshot 2025-02-21 160434.png

            If you don't have any non-MSVC compiler, you can add one using the add button.
            Usually, the MinGW compiler bundled with Qt can be found in the path: .../Qt/tools/mignw{numbers}/bin/gcc.exe

            After adding it, you can set it as a default compiler in the Kits tab

            SGaistS 1 Reply Last reply
            0
            • emman_fosuE emman_fosu

              @Josko It is surprising the program compiles but does not autocomplete.
              Try to change the compiler if it will work. I am currently on Qt Creator 15.00 and Qt 6.8 using the MinGW x86 64-bit compiler that comes bundled with Qt and it works here.

              You can change the compiler settings by going to Edit > preferences > Kits
              This is a screenshot of the compiler tab of Kits.
              Screenshot 2025-02-21 160434.png

              If you don't have any non-MSVC compiler, you can add one using the add button.
              Usually, the MinGW compiler bundled with Qt can be found in the path: .../Qt/tools/mignw{numbers}/bin/gcc.exe

              After adding it, you can set it as a default compiler in the Kits tab

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @emman_fosu except for one thing: you cannot exchange Visual Studio for MinGW to build C++ code. They are not compatible so installing the matching version of Qt is mandatory if you want to ensure that you can also build.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • J Offline
                J Offline
                Josko
                wrote on last edited by Josko
                #6

                I have upgraded my QT to 6.7.3 so as MSVC from 2019 to 2022 so as installed MinGW but these only partially solved the problem (std::vector started to autocomplete but std::string not).
                But found out what made autocomplete to work fully: checking the box Use clangd in Clangd tab under Preferences -> C++ .
                Seems it has to be done with every new project.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  Josko
                  wrote on last edited by Josko
                  #7

                  P.S. I have noticed now some stupid X-small-font warning like: "ClangD was automatically disabled because it can consume much resources on my system bla bla..." (although have 8 Gigs and I7). Seems I somehow succeeded to remove that "fuse" even for new projects now, not sure how.
                  Oh God... I have developed code under Visual Studio 2008 before a decade ago with Intellisense with only 2,5 Gigs RAM ...

                  1 Reply Last reply
                  0
                  • J Josko has marked this topic as solved on

                  • Login

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