From b8ddf58d75fcdbf63149e6168707bca15f27872d Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Wed, 11 Dec 2024 13:00:37 -0500 Subject: [PATCH] Fix the usage of qFatal For Qt 6.2 --- Pico/BasicSourcePrinter.cpp | 10 ++++++++-- Pico/ESPSourcePrinter.cpp | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Pico/BasicSourcePrinter.cpp b/Pico/BasicSourcePrinter.cpp index 945e2cc..eeb4e01 100644 --- a/Pico/BasicSourcePrinter.cpp +++ b/Pico/BasicSourcePrinter.cpp @@ -11,6 +11,8 @@ #include #include +#include + namespace Pico { static const std::string error_string = ":*:ERROR:*:"; @@ -65,8 +67,12 @@ QString BasicSourcePrinter::printTask( } else { - qFatal() << "Process:" << p->metadata().getName() << typeid(*p).name() - << " does not have a code writer"; + QString fatalMessage; + QTextStream outputStream(&fatalMessage); + outputStream << "Process:" << p->metadata().getName() << typeid(*p).name() + << " does not have a code writer"; + outputStream.flush(); + qFatal(qPrintable(fatalMessage)); } } diff --git a/Pico/ESPSourcePrinter.cpp b/Pico/ESPSourcePrinter.cpp index cd943f7..b7ba7c3 100644 --- a/Pico/ESPSourcePrinter.cpp +++ b/Pico/ESPSourcePrinter.cpp @@ -9,6 +9,8 @@ #include #include +#include +#include namespace Pico { @@ -97,8 +99,12 @@ QString ESPSourcePrinter::printTask( } else { - qFatal() << "Process:" << p->metadata().getName() << typeid(*p).name() + QString fatalMessage; + QTextStream outputStream(&fatalMessage); + outputStream << "Process:" << p->metadata().getName() << typeid(*p).name() << " does not have a code writer"; + outputStream.flush(); + qFatal(qPrintable(fatalMessage)); } }