Issues flagged in QtCreator
-
Using QtCreator 10.0.0 (based on MSVC 2019), Qt_5_15_13_MinGW_32_bit. Project built with cmake. My problem is that the error/warning flags in the source code and in the 'issues' pane are highly intermittent. Sometimes my code looks pretty clean, but other times it looks like this image:
I cant figure how to control this behavior. In spite of all these flagged errors, the code runs fine in debug mode.
One of the errors reads:
dacqform.cpp:1295:7: No matching function for call to 'setWidgetErrorColor'
BIPS20Common.h:530:6: candidate function not viable: no known conversion from 'QPushButton *' to 'QWidget *' for 1st argument.
The flagged methods are all standard Qt, and at other times these kinds of flags for core Qt functions in particular do not appear. Same source code, same settings, just different day! -
And the project compiles and runs just fine, right?
Are you using unity builds? QtC gets very confused with them. Turning them off should solve the problem then.
If not - QtC 10.0.1 has been released yesterday, try updating.
Lastly - try reconfiguring the project (remove build dir, configure the project again in Qt Creator). Low chances but it might help.
-
@sierdzio Yes, the project compiles and runs just fine in spite of all the flagged issues.
Just to make things clear, I shut down Qt last night, re-started this morning, no OS restart in between, and here is exactly the same code with no errors flagged (makes reading and working with the code much easier):
Apologies, but I dont know what a 'Unity Build' is! And what is QtC? Does that just mean Qt for C++?
I often remove the build dir to re-build a project before distributing to my users, but not this time. -
@nekkceb said in Issues flagged in QtCreator:
Apologies, but I dont know what a 'Unity Build' is! And what is QtC? Does that just mean Qt for C++?
I often remove the build dir to re-build a project before distributing to my users, but not this time.QtC is Qt Creator, the IDE you are using.
If you don't know about Unity Builds then you are not using them, that's one problem solved already :-)
-
-
@nekkceb said in Issues flagged in QtCreator:
and here is exactly the same code with no errors flagged
So from where you are now do the errors re-appear? I guess you said "'issues' pane are highly intermittent.".
You don't want to hear what I might have to say about the frankly ridiculous number of Qt Creator major releases which have come out in the last couple of years, or the sometimes issues with the clang code-completer. You might want to try:
- Disable the clang Code Completer in Creator and run with the inbuilt one. [Oh, I am Linux, I don't know whether you have this under Windows/MSVC.]
- Downgrade to the last Creator 9.x.
These may not be long-term solutions, but might give us a clue.
-
@JonB Could not find anything that says "clang code completer", but I did find an item in the preferences->Text Editor->Display that says "Line Annotations", which was on. I turned that off. the long explanations for the 'errors' in the code text editor window went away, but the errors are still flagged with red circle on the left, and in the issues pane. Again, in spite of all, the code runs OK!
And, on days that are prime numbers or when the phase of the moon is just right, these 'errors' are not flagged. Tongue in cheek there, I have no idea why this happens sometimes and not others.