GuiPy: [skip ci] handle some Qt warnings when using GUI from Python

+ avoid warning: QEventLoop: Cannot be used without QApplication
+ avoid warning: QObject::startTimer: Timers can only be used with threads started with QThread
This commit is contained in:
wmayer
2020-06-20 11:43:59 +02:00
parent 9f9ee6d89e
commit 278202eb6f
2 changed files with 37 additions and 7 deletions

View File

@@ -147,14 +147,17 @@ namespace Gui {
// Pimpl class
struct ApplicationP
{
ApplicationP() :
ApplicationP(bool GUIenabled) :
activeDocument(0L),
editDocument(0L),
isClosing(false),
startingUp(true)
{
// create the macro manager
macroMngr = new MacroManager();
if (GUIenabled)
macroMngr = new MacroManager();
else
macroMngr = nullptr;
}
~ApplicationP()
@@ -451,7 +454,7 @@ Application::Application(bool GUIenabled)
View3DInventorViewerPy ::init_type();
AbstractSplitViewPy ::init_type();
d = new ApplicationP;
d = new ApplicationP(GUIenabled);
// global access
Instance = this;