if you carefully read documentation about QApplication you will see that there is qApp macro which performs access to an application instance.
so, you can use this macro whenever you need.
int main(int argc, char **argv)
{
MyWidget mw;
mw.show();
return app.exec();
}
void MyWidget::loop()
{
while (m_flag) {
...
qApp->processEvents();
}
}
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MyWidget mw;
mw.show();
return app.exec();
}
void MyWidget::loop()
{
while (m_flag) {
...
qApp->processEvents();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks