Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Environmental Variables PATH I need to add for Qt5 to recognize include <QtGui/QApplication>

What Environmental Variables PATH I need to add for Qt5 to recognize include ?

  • I already added “C:\qt5\2012.11\qtbase\bin and C:\qt5\2012.11\qtbase\lib".

I used VS2012 command prompt to build Qt5Sdk and it's work, but it's not recognize

include QtGui/QApplication,

include QFileDialog

and more...it's does recognize

include QGui

.

maybe VS2012 build didn't goes well?

  • BTW in Windows7 where's are the INCLUDE, LIB and LIBPATH, becaise I can see I can set them from Qt, but when entered windows 7 environment variables there is only PATH?

Thanks!

like image 338
GoldenAxe Avatar asked Dec 26 '22 14:12

GoldenAxe


2 Answers

In Qt5, QApplication class was moved from QtGui modul to QtWidgets.

So, instead of

#include <QtWidgets/QApplication> 

put

#include <QtGui/QApplication> 

and instead of

QT += core gui 

you should have

QT += core gui widgets  
like image 161
user40 Avatar answered Dec 29 '22 05:12

user40


In Qt5, you need to specify the modules you're using in your Qt project file. In this case:

QT += widgets

This should take care of configuring the include directories correctly.

like image 41
Nikos C. Avatar answered Dec 29 '22 05:12

Nikos C.