'QtGui/QMainWindow' file not found
-
Hi,
I can't build my project, with the Error 'QtGui/QMainWindow' file not found at the line:@#include <QtGui/QMainWindow>@
The autocomplete doesnt show the 'QtGui' or something, only 'QtUiTools'.
I looked in the Libraries/Frameworks (OS X) but there are no Qt files.Thank for help
-
use in projectfile:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
...using Qt 5.x, write only:
...
#include <QMainWindow>
...that should work
greetings walur -
I already tried it...
-
Hi and welcome to devnet,
What version of Qt are you using on what version of OS X ?
-
Qt 5.1.1 and OS X 10.9
-
The I would recommend to change directly to 5.2, it has better support for 10.9.
Also, did you change the #include <QtGui/QMainWindow> line ? In Qt 5 it's in the QtWidgets module
-
@SGaist I am compiling qt 4.8.6 windows code over linux with GDB, I am too facing 'QMainWindow' not found.
I am using the below lines,
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgetsThanks
Sravanthi -
Do you have
#include <QMainWindow>
only ? Or do you have the module before ? If the second, just remove the module from the include line. -
@SGaist #include <QMainWindow> is palced on top.
The following link is asking to edit the cmake file, where can i find the cmake file ?
-
You are using a .pro file so it doesn't apply.
How did you install Qt ?