From 22a88dce03f12c70aa9987570cc408829cb2574e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 21 Feb 2017 08:43:12 +0100 Subject: QErrorMessage: handle all message types The perils of adding a default: case to a switch over an enum type: the compiler no longer warns when the enum is extended. Provide strings for QtCriticalMsg and QtInfoMsg, too. [ChangeLog][QtWidgets][QErrorMessage] No longer displays critical (QtCriticalMsg) and informational (QtInfoMsg) messages as if they were debug (QtDebugMsg) ones. Change-Id: Id6776081be736ad92423ec016988dcd92a963cc7 Reviewed-by: Friedemann Kleint Reviewed-by: Mitch Curtis Reviewed-by: David Faure Reviewed-by: Edward Welbourne --- src/widgets/dialogs/qerrormessage.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index 5fcbe3fe9d..bcfc00d982 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -163,14 +163,20 @@ static void jump(QtMsgType t, const QMessageLogContext & /*context*/, const QStr switch (t) { case QtDebugMsg: - default: rich = QErrorMessage::tr("Debug Message:"); break; case QtWarningMsg: rich = QErrorMessage::tr("Warning:"); break; + case QtCriticalMsg: + rich = QErrorMessage::tr("Critical Error:"); + break; case QtFatalMsg: rich = QErrorMessage::tr("Fatal Error:"); + break; + case QtInfoMsg: + rich = QErrorMessage::tr("Information:"); + break; } rich = QString::fromLatin1("

%1

").arg(rich); rich += Qt::convertFromPlainText(m, Qt::WhiteSpaceNormal); -- cgit v1.2.3