Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 4.7.0-beta1
-
None
-
WIN7 x64, Qt5.10, QtCreator 4.7 beta1, qmake + cmake
Description
In a simple gui created with the qt widgets application template (no modifications) the following lines result in some code model warnings, at some point of time, not right after project loading, but after a short period of time or writing some code it comes up:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this);}
...\Documents\cpp17test\mainwindow.cpp:7: error: allocation of incomplete type 'Ui::MainWindow' ...\Documents\cpp17test\mainwindow.cpp:9: error: member access into incomplete type 'Ui::MainWindow'
the code model does not find the generated ui_mainwindow.h. If I follow the #include a temporary empty file with that name gets opened, for example:
C:\Users\...\AppData\Local\Temp\QtCreator-PYLxbA\clang-uiheader-prYAeG\ui_mainwindow.h
I tried this both with a qmake project and a cmake project, both resulting in the same errors. Compilation does work fine however.
In the cmake project I worked arround it by adding the project_autogen folder explicitly to the include folders and using
#include <include/ui_mainwindow.h>
instead, which points to the correct, generated file. Right now I did not try to find a work arround with qmake.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-20705 Generated .ui header files corrupt the clang code model
- Closed