srikpen
28th January 2007, 06:59
In the below code when the quit() is replaced with a fuction say myquit(), Why doesn't my app/window terminate? It only works where SLOT( quit()) ) why?
thanks.
#include <qapplication.h>
#include <qpushbutton.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *button = new QPushButton("Quit", 0);
QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
app.setMainWidget(button);
button->show();
return app.exec();
}
thanks.
#include <qapplication.h>
#include <qpushbutton.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton *button = new QPushButton("Quit", 0);
QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit()));
app.setMainWidget(button);
button->show();
return app.exec();
}