QItemDelegate: Use QString::replace instead of home brew algorithm

Change-Id: I491b6167147de48bd3be2aaf616c9dad43dabebb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann 2017-07-23 19:01:43 +02:00 committed by André Hartmann
parent f43de3ed31
commit c6726b5797

View File

@ -94,10 +94,7 @@ public:
inline static QString replaceNewLine(QString text)
{
const QChar nl = QLatin1Char('\n');
for (int i = 0; i < text.count(); ++i)
if (text.at(i) == nl)
text[i] = QChar::LineSeparator;
text.replace(QLatin1Char('\n'), QChar::LineSeparator);
return text;
}