[ui] app: temporary workaround for qInstallMessageHandler

This commit is contained in:
Fabien Castan 2023-01-19 09:46:49 +01:00
parent 56fe514582
commit 922ee7b652

View file

@ -3,6 +3,7 @@ import os
import re import re
import argparse import argparse
from PySide2 import QtCore
from PySide2.QtCore import Qt, QUrl, Slot, QJsonValue, Property, Signal, qInstallMessageHandler, QtMsgType, QSettings from PySide2.QtCore import Qt, QUrl, Slot, QJsonValue, Property, Signal, qInstallMessageHandler, QtMsgType, QSettings
from PySide2.QtGui import QIcon from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QApplication from PySide2.QtWidgets import QApplication
@ -123,6 +124,8 @@ class MeshroomApp(QApplication):
self.engine.setWatching(os.environ.get("MESHROOM_INSTANT_CODING", False)) self.engine.setWatching(os.environ.get("MESHROOM_INSTANT_CODING", False))
# whether to output qml warnings to stderr (disable by default) # whether to output qml warnings to stderr (disable by default)
self.engine.setOutputWarningsToStandardError(MessageHandler.outputQmlWarnings) self.engine.setOutputWarningsToStandardError(MessageHandler.outputQmlWarnings)
if QtCore.__version_info__ < (5, 14, 2):
# After 5.14.1, it gets stuck during logging
qInstallMessageHandler(MessageHandler.handler) qInstallMessageHandler(MessageHandler.handler)
self.engine.addImportPath(qmlDir) self.engine.addImportPath(qmlDir)