QtCreator 12: Highlighting not properly work
-
Hi folks!
I was using Qt-creator 6.0.2 and the word's highlighting worked very well. An example could be "bool" and "assert".
I always used this IDE for c project.
Now, i tried to install (through unified installer) qt6 and qt creator 12.
For some weird reason, the above keywords are not highlighted anymore.
Why ? How to fix it?
Best regards -
Hi folks!
I was using Qt-creator 6.0.2 and the word's highlighting worked very well. An example could be "bool" and "assert".
I always used this IDE for c project.
Now, i tried to install (through unified installer) qt6 and qt creator 12.
For some weird reason, the above keywords are not highlighted anymore.
Why ? How to fix it?
Best regards -
@Nick79 I saw some weird behaviors as well when I started to use qt creator 12. On Ubuntu I removed the contents in ~/ .cache/QtProject/QtCreator and then it seems working fine for me. bool is highlighted in my code.
@JoeCFD said in QtCreator 12: Highlighting not properly work:
@Nick79 I saw some weird behaviors as well when I started to use qt creator 12. On Ubuntu I removed the contents in ~/ .cache/QtProject/QtCreator and then it seems working fine for me. bool is highlighted in my code.
Thanks for feedback.
I'll try that and let you know the result. -
Didn't work!
Following the screenshot of qt creator 6.0.2:

Instead, this is the screenshot of qt creator 12.0.2

you can see the difference about "bool" and "assert" keywords which are not highlighted.
-
@Nick79 Try to remove the contents in ~/.config/QtProject. Make a copy of this folder first before removal. just in case.
@JoeCFD I tried but didn't work yet.
Moreover, when i select a variable next to bool keyword, it highlights the next word rather than that word.
An example:bool first, second, third;When i select "first", the "second" keyword is highlighted.
Maybe is it a bug ? -
@JoeCFD I tried but didn't work yet.
Moreover, when i select a variable next to bool keyword, it highlights the next word rather than that word.
An example:bool first, second, third;When i select "first", the "second" keyword is highlighted.
Maybe is it a bug ? -
@Nick79 Could be c code related bug. No issue with C++ code in my app.
In C, the bool data type is not a built-in data type@JoeCFD
I only can say you that in qt creator 6.0.2, stdbool.h is placed in /usr/lib64/clang/13.0.0/include/stdbool.h
In qt creator 12.0.2 instead, stdbool.h is placed in /opt/Qt6/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/17/include/stdbool.h.
The contents seem be different.... -
@JoeCFD
I only can say you that in qt creator 6.0.2, stdbool.h is placed in /usr/lib64/clang/13.0.0/include/stdbool.h
In qt creator 12.0.2 instead, stdbool.h is placed in /opt/Qt6/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/17/include/stdbool.h.
The contents seem be different.... -
Now, I don't remember because the project has been created some months ago...perhaps one year ago.
Likely, it has been created as C++ project but the added class have been renamed from .cpp in .c, making, basically, a C project.
Now, when I import it into Qt creator 12.0.2, the latter see it as C project and then some things don't properly work. -
@Nick79 If you use meson to build your project, you may not need qt creator. Try VS code to see if it helps.
@JoeCFD
Actually, qt creator has a plugin for meson even if it is esperimental and seems to work well.
Anyway, I don't use it, I put it into project and I defined the steps to build and clean the project in a very nice way.
In qt creator 6.0.2 works like a charm. -
@JoeCFD
Actually, qt creator has a plugin for meson even if it is esperimental and seems to work well.
Anyway, I don't use it, I put it into project and I defined the steps to build and clean the project in a very nice way.
In qt creator 6.0.2 works like a charm. -
@Nick79 I know qt creator has a plugin for meson. But I built a few packages only from command line with meson. meson build is 10 times faster than cmake in one project.
@JoeCFD
Yeah, indeed i don't use cmake. The defined some custom steps for building and cleaning the project. Very fast.
Qt creator allows me to customize whatever things and my projects are the real examples.
I don't like vscode because the debug as root user, which is an important feature for me, is almost hard to configure. In qt creator is very easy to set.