summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-30 01:00:19 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-09-30 01:00:19 +0200
commit07e92611050f78dae93bcd362112efd8efa7b41e (patch)
tree6951f77a6344436150c4f83f407e09d946f2c6c3 /src/corelib/tools
parent69e68218e5082166d5c4ab1903fbacde00418a1c (diff)
parentcaa598c843eb27fd0c645e62723fd2d4e3e12f60 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 4c55880915..279d6565da 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -1049,7 +1049,11 @@ QString QCommandLineParser::helpText() const
static QString wrapText(const QString &names, int longestOptionNameString, const QString &description)
{
const QLatin1Char nl('\n');
- QString text = QLatin1String(" ") + names.leftJustified(longestOptionNameString) + QLatin1Char(' ');
+ const QLatin1String indentation(" ");
+ if (description.isEmpty())
+ return indentation + names + nl;
+
+ QString text = indentation + names.leftJustified(longestOptionNameString) + QLatin1Char(' ');
const int indent = text.length();
int lineStart = 0;
int lastBreakable = -1;