Visual Studio C++ basic project cannot open source file "ui_DialogGui.h
-
- Just basic project on MSVC++ 2017. I created simple QT Gui application then I added on Form Files new QT GUI class with name DialogGui, and try to compile. It is not possible to compile:
here is the message from Visual C++ compiler.
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file "ui_DialogGui.h" ... \DialogGui.h 4What is ui_DialogGui.h? Where it is located? I try through google to find some help. Here is what I have found:
https://stackoverflow.com/questions/19711564/qt-5-migration-cannot-open-include-file-ui-mainwindow-h
Basically it points out to:
"I had the same problem; solved cleaning the project (From Qt->Build) and adding:
SET(CMAKE_INCLUDE_CURRENT_DIR ON)"
the problem is that I could not find:--CMakeListsbolded text.txt file for Visual C++ projects.
It seems to me that problem might be with setting up include path in Visual C++, but where is located ui_DialogGui.h?
-
@Tamis2018 ui_DialogGui.h is a header file which will be generated by the moc tool (see http://doc.qt.io/qt-5/moc.html for more information). Do you use the Qt plug-in for Visual Studio?
-
@jsulm I believe that is the problem:
and that seems to be problem...
well, where QT include files are found?
I could not see where include from qt is comming from?That is more or less what you might need to know where I am...
Here is what I have followed when I installed that qt with Visual C++ 2017 -
@Tamis2018 So your app now compiles and runs?
Mybutton is not visible in QtDesigner because you create it in your code manually - QtDesigner does not know anything about it.
The other 3 buttons are visible in your code. You need to access them through ui->BUTTON_NAME. All UI elements handled by QtDesigner are accessible in code via ui pointer (ui->). Take a look at https://doc-snapshots.qt.io/qt5-5.9/designer-using-a-ui-file.html#