Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20579

clang code model does not find/use the correct autogenerated ui headers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • Qt Creator 4.7.0-rc1
    • Qt Creator 4.7.0-beta1
    • C/C++/Obj-C++ Support
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              yvvan Ivan Donchevskii
              egonuel Immanuel Weber
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes