Replace occurrences of QStringList() << pattern

Change-Id: I598d8c06193c2e72435a76165d1afc9ee3465b48
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2017-02-09 14:00:07 +01:00
parent 7f8e60b289
commit e952b9d4f3
16 changed files with 77 additions and 119 deletions

View File

@@ -116,8 +116,7 @@ static QVector<QString> splitInTwoLines(const QString &text, const QFontMetrics
if (splitPos < 0) {
splitLines[0] = fontMetrics.elidedText(text, Qt::ElideRight,
availableWidth);
QString common = Utils::commonPrefix(QStringList()
<< splitLines[0] << text);
QString common = Utils::commonPrefix(QStringList({ splitLines[0], text }));
splitLines[1] = text.mid(common.length());
// elide the second line even if it fits, since it is cut off in mid-word
while (fontMetrics.width(QChar(0x2026) /*'...'*/ + splitLines[1]) > availableWidth