Reputation: 560
I have a simple QT object. When I execute the code below the control is transfer to the QT object, but I would like to make the QT part work like a thread.
int main(int argc, char *args[])
{
gui *GUI;
//// before call
QApplication app(argc,args);
GUI = new gui();
GUI->show();
////i want to be able to do stuff here in parallel with the QT code.
// If I spawn a thead here or give a simple printf statement here
// or before call it executes only after GUI exits
return app.exec();
}
Upvotes: 1
Views: 183
Reputation: 328556
Make sure you not only create the thread but actually start it. Also, a printf()
statement will execute before the GUI shows unless you forgot to terminate the string with a newline (\n
).
Upvotes: 3