Take a look at the following code:
#include <QDebug>
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
qDebug() << QCoreApplication::instance();
QCoreApplication app2(argc, argv);
qDebug() << QCoreApplication::instance();
return 0;
}
It looks like it's possible to create multiple QCoreApplication objects, but this should be a singleton. What happens to the first QCoreApplication object created? Is it destroyed or will there be two event loops when exec is called for two objects?
scdmb source
share