qcommandlineparser: use const method more

to avoid implicit detach

Change-Id: If01c2d777ceb61e9f919ff0109d054bb7e74a418
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Anton Kudryavtsev 2023-09-07 14:49:29 +03:00
parent a7b50c40a0
commit 2c1fdad76c

View File

@ -508,7 +508,7 @@ QString QCommandLineParser::errorText() const
if (!d->errorText.isEmpty())
return d->errorText;
if (d->unknownOptionNames.size() == 1)
return tr("Unknown option '%1'.").arg(d->unknownOptionNames.first());
return tr("Unknown option '%1'.").arg(d->unknownOptionNames.constFirst());
if (d->unknownOptionNames.size() > 1)
return tr("Unknown options: %1.").arg(d->unknownOptionNames.join(QStringLiteral(", ")));
return QString();