From eeb07756d3e4dd2593994e49aaa97cdfe1fea75f Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Tue, 20 Oct 2020 17:34:04 +0200 Subject: [PATCH] Install message handler after instanciating MainApplication Fix #514 related to QT bug https://bugreports.qt.io/browse/QTBUG-27024 : "Crash if QGuiApplication::font() is used without instancing QGuiApplication first" --- src/app/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index 8b6200b..a0d7044 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -75,15 +75,16 @@ void logMessageHandler(QtMsgType type, const QMessageLogContext &context, const int main(int argc, char *argv[]) { - // Install message handler - qInstallMessageHandler(logMessageHandler); - set_env_vars_if_needed(); // Initialize meta-object registry. initRegistry(); MainApplication app(argc, argv); + + // Install message handler + // after QGuiApplication has been instanciated + qInstallMessageHandler(logMessageHandler); #if USING_QT_5 QCommandLineParser parser;