Aztral
10th August 2009, 19:32
I have a class, call it server, which inherits from QTcpServer.
My main looks like this:
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
new server();
return app.exec()
}
My question is, since server inherits from QTcpServer, how can I get app.exec() to return thus properly calling the destructor for server(). Right now I'm not sure how I can get into the server() destructor and also exit the main QT event loop so that the program will quit.
I can properly delete the server() class with deleteLater() or a few other ways, but doing so doesn't terminate the program, I think because I'm still in the main event loop.
Thanks a lot.
My main looks like this:
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
new server();
return app.exec()
}
My question is, since server inherits from QTcpServer, how can I get app.exec() to return thus properly calling the destructor for server(). Right now I'm not sure how I can get into the server() destructor and also exit the main QT event loop so that the program will quit.
I can properly delete the server() class with deleteLater() or a few other ways, but doing so doesn't terminate the program, I think because I'm still in the main event loop.
Thanks a lot.