[skip ci] improve possibility to create a QApplication in a thread

This commit is contained in:
wmayer
2020-06-21 00:07:21 +02:00
parent 002e25b561
commit daec778694
3 changed files with 9 additions and 3 deletions

View File

@@ -126,8 +126,6 @@ ConsoleSingleton::ConsoleSingleton(void)
,_defaultLogLevel(FC_LOGLEVEL_MSG)
#endif
{
// make sure this object is part of the main thread
ConsoleOutput::getInstance();
}
ConsoleSingleton::~ConsoleSingleton()
@@ -233,6 +231,11 @@ bool ConsoleSingleton::IsMsgTypeEnabled(const char* sObs, FreeCAD_ConsoleMsgType
void ConsoleSingleton::SetConnectionMode(ConnectionMode mode)
{
connectionMode = mode;
// make sure this method gets called from the main thread
if (connectionMode == Queued) {
ConsoleOutput::getInstance();
}
}
/** Prints a Message