QT Creator not showing autocomplete for C++ methods
-
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!! -
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. -
@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 theMinGW 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.
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.exeAfter adding it, you can set it as a default compiler in the Kits tab
-
@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.