Shouri
8th January 2012, 19:35
I don't know why a.exec() won't return and end the process! It's a simple code:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDialog w;
w.setAttribute(Qt::WA_QuitOnClose);
w.exec();
return a.exec();
}
It was supposed to open a dialog and when I hit the 'X' button it should close and end the process, but instead the process keeps running!.. Anyone knows why?
P.S: I know I could've used QDIalog::show() method instead of QDIalog::exec() and it would work fine, but I really want to understand why it won't work this way. This is just a simple code, but I'll need it to construct more complex ones.
Thanks o/
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDialog w;
w.setAttribute(Qt::WA_QuitOnClose);
w.exec();
return a.exec();
}
It was supposed to open a dialog and when I hit the 'X' button it should close and end the process, but instead the process keeps running!.. Anyone knows why?
P.S: I know I could've used QDIalog::show() method instead of QDIalog::exec() and it would work fine, but I really want to understand why it won't work this way. This is just a simple code, but I'll need it to construct more complex ones.
Thanks o/