From 30225da91f89f7c0356bbc930896ee3e14319aae Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 4 Mar 2024 16:40:58 +0100 Subject: [PATCH] qErrnoWarning: downgrade from critical to warning The name says it's a warning, it's pretty unexpected that it should lead to a critical message. One case where this is a problem is QTBUG-48488 where merely printing with "Microsoft Print To PDF" and canceling the file dialog leads to "QWin32PrintEngine::begin: StartDoc failed" as a *critical* message. Some Windows applications have a message handler that shows a msgbox in case of a critical message, and getting such a msgbox after canceling the file dialog seems very wrong. Task-number: QTBUG-48488 Pick-to: 6.7 Change-Id: I1c842340dd2faf2be6e64e0522f9e2b33547d3cf Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index a9daedc70f3..449b8a1eea9 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -2075,7 +2075,7 @@ void qErrnoWarning(const char *msg, ...) buf += " ("_L1 + error_string + u')'; QMessageLogContext context; - qt_message_output(QtCriticalMsg, context, buf); + qt_message_output(QtWarningMsg, context, buf); } void qErrnoWarning(int code, const char *msg, ...) @@ -2089,7 +2089,7 @@ void qErrnoWarning(int code, const char *msg, ...) buf += " ("_L1 + qt_error_string(code) + u')'; QMessageLogContext context; - qt_message_output(QtCriticalMsg, context, buf); + qt_message_output(QtWarningMsg, context, buf); } /*!