PDA

View Full Version : qApp is not accesible



URPradhan
9th July 2009, 14:57
Hi

In my dialog class I have a command button meant for application exit. And in my dialog's constructor I'm trying to connect the button click signal with application's quit slot, like ....


connect(cmdExit, SIGNAL(clicked()), qApp, SLOT(quit()));


But, the compiler giving error, saying qApp was not declared in this scope !!! But as per docs its a macro which gives the pointer to application's instance.

Please help.

nish
9th July 2009, 15:07
#include <QApplication>
in your file

rexi
9th July 2009, 15:11
Do you have


#include <QApplication>

in the source file where you use qApp?

rexi
9th July 2009, 15:12
Damn, too late ;)

nish
9th July 2009, 15:19
Damn, too late ;)
better luck next time :):)

URPradhan
10th July 2009, 04:23
Oh ! wt a mistake :(
Thank you.