summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcommandlineparser.h
diff options
context:
space:
mode:
authorWang Zichong <wangzichong@uniontech.com>2024-07-29 15:48:46 +0800
committerWang Zichong <wangzichong@deepin.org>2024-08-23 10:23:46 +0800
commitbad618606d64e943e3fa78e7d1dbc8e1fab55480 (patch)
treeea9e99e730cd60152b85d57968294cae859f74e2 /src/corelib/tools/qcommandlineparser.h
parentb30edf6fe3701c5de8d175bab6106922ec312267 (diff)
QCommandLineParser: rename showParserMessage() and make it a public API
This makes developer be able to use the same way to display commandline message as the ones provided by Qt internal (e.g. --help, --about). Fixes: QTBUG-127577 Change-Id: I2d3be8b5885cd1fba12978ab7b1afee4f37da0cd Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/tools/qcommandlineparser.h')
-rw-r--r--src/corelib/tools/qcommandlineparser.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qcommandlineparser.h b/src/corelib/tools/qcommandlineparser.h
index 332a2f95687..05308c1fe93 100644
--- a/src/corelib/tools/qcommandlineparser.h
+++ b/src/corelib/tools/qcommandlineparser.h
@@ -67,6 +67,12 @@ public:
Q_NORETURN void showHelp(int exitCode = 0);
QString helpText() const;
+ enum MessageType {
+ InformationMessage,
+ ErrorMessage
+ };
+ Q_NORETURN static void showMessageAndExit(const QString &message, MessageType type, int exitCode = 0);
+
private:
Q_DISABLE_COPY(QCommandLineParser)