From e69e53de8e652b7bff73388e6d0d5099f1e728bc Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Mon, 16 Dec 2024 11:48:57 +0100 Subject: [PATCH] Add docs to the new QCommandLineParser::MessageType enum As a drive-by: move the \since command in the showMessageAndExit() docs to the right place. Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480. Change-Id: I4e6e6d63929029879867624e4007941edfca9cd9 Reviewed-by: David Faure (cherry picked from commit 6692beace9bb5f461d71935e500e1c6ccfa97fd1) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qcommandlineparser.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index 5aa1cc9d697..0f421d57438 100644 --- a/src/corelib/tools/qcommandlineparser.cpp +++ b/src/corelib/tools/qcommandlineparser.cpp @@ -531,6 +531,23 @@ static inline bool displayMessageBox() #endif // Q_OS_WIN && !QT_BOOTSTRAPPED /*! + \enum QCommandLineParser::MessageType + \since 6.9 + + The enum is used to specify the type of the message and how it will be shown + to the users. + + \value InformationMessage Used to show information messages. The message + will be printed to \c {stdout}. + \value ErrorMessage Used to show error messages. The message will be printed + to \c {stderr}. + + \sa showMessageAndExit() +*/ + +/*! + \since 6.9 + Displays a \a message, and exits the application with the given \a exitCode. The \a message will usually be printed directly to \c{stdout} or \c{stderr} according @@ -543,8 +560,7 @@ static inline bool displayMessageBox() options (\c{--version} if addVersionOption was called and \c{--help} / \c{--help-all} if addHelpOption was called). - \sa addVersionOption(), showHelp(), showVersion() - \since 6.9 + \sa addVersionOption(), showHelp(), showVersion(), QCommandLineParser::MessageType */ Q_NORETURN void QCommandLineParser::showMessageAndExit(const QString &message, MessageType type, int exitCode) {