start thread after window showing

This commit is contained in:
Rafael 2016-03-22 06:15:14 +01:00
parent 4334537966
commit c98d5ba154

View file

@ -62,7 +62,6 @@ int main(int argc, char *argv[])
ProfileDatabase *profileDB = new ProfileDatabase(); ProfileDatabase *profileDB = new ProfileDatabase();
DatabaseThread *threadDB = new DatabaseThread(crewDB); DatabaseThread *threadDB = new DatabaseThread(crewDB);
QObject::connect(threadDB, SIGNAL(playerNameFound(int,QString)), profileDB, SLOT(setPlayerName(int,QString))); QObject::connect(threadDB, SIGNAL(playerNameFound(int,QString)), profileDB, SLOT(setPlayerName(int,QString)));
threadDB->start();
if (selectedAction == "showpic") if (selectedAction == "showpic")
{ {
@ -77,6 +76,7 @@ int main(int argc, char *argv[])
if (!readOk) { return 1; } if (!readOk) { return 1; }
QObject::connect(threadDB, SIGNAL(playerNameUpdated()), picDialog, SLOT(on_playerNameUpdated())); QObject::connect(threadDB, SIGNAL(playerNameUpdated()), picDialog, SLOT(on_playerNameUpdated()));
threadDB->start();
picDialog->show(); picDialog->show();
return a.exec(); return a.exec();