I am developing a project using MinGW and qmake with Qt Creator IDE. For some time I have been receiving strange and completely baseless clangd warnings in the QT Creator editor, but the code still compiles correctly. I created a new project to check if I would receive similar warnings and the newly created project works properly without errors. What could I have done wrong in my project that I am getting these errors and how can I fix it? Below are some warnings and a fragment of the .pro file.

.pro file fragment:
Qt Code:
  1. QT += core gui
  2. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  3. CONFIG += c++20
  4. CONFIG += qwt
  5. CONFIG += staticlib
  6. CONFIG += static-libgcc
  7. CONFIG += static-libstdc++
  8. CONFIG += disable-desktop
  9. CONFIG += qtquickcompiler
To copy to clipboard, switch view to plain text mode 

Some Qt components include are getting errors, e.g. this:
Qt Code:
  1. #include <QWidget>
To copy to clipboard, switch view to plain text mode 
is generating this error:
Qt Code:
  1. In included file: unexpected type name 'size_t': expected expression
To copy to clipboard, switch view to plain text mode 

Also the range based C++11 for loops are generating errors:
Qt Code:
  1. for (auto button : buttonGroup_alphabetic.buttons()) {
  2. button->setText(button->text().toUpper());
  3. }
To copy to clipboard, switch view to plain text mode 
error:
Qt Code:
  1. Expected '(' for function-style cast or type construction
To copy to clipboard, switch view to plain text mode