[skip ci] make Jupyter notebook integration working again
This commit is contained in:
@@ -120,17 +120,20 @@ FreeCADGui_showMainWindow(PyObject * /*self*/, PyObject *args)
|
||||
t.detach();
|
||||
}
|
||||
else {
|
||||
// In order to get Jupiter notebook integration working we must create a direct instance
|
||||
// of QApplication. Not even a sub-class can be used because otherwise PySide2 wraps it
|
||||
// with a QtCore.QCoreApplication which will raise an exception in ipykernel
|
||||
#if defined(Q_OS_WIN)
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QtApplication(argc, argv);
|
||||
(void)new QApplication(argc, argv);
|
||||
// When QApplication is constructed
|
||||
hhook = SetWindowsHookEx(WH_GETMESSAGE,
|
||||
FilterProc, 0, GetCurrentThreadId());
|
||||
#elif !defined(QT_NO_GLIB)
|
||||
static int argc = 0;
|
||||
static char **argv = {0};
|
||||
(void)new QtApplication(argc, argv);
|
||||
(void)new QApplication(argc, argv);
|
||||
#else
|
||||
PyErr_SetString(PyExc_RuntimeError, "Must construct a QApplication before a QPaintDevice\n");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user