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:
parent
f43de3ed31
commit
c6726b5797
@ -94,10 +94,7 @@ public:
|
|||||||
|
|
||||||
inline static QString replaceNewLine(QString text)
|
inline static QString replaceNewLine(QString text)
|
||||||
{
|
{
|
||||||
const QChar nl = QLatin1Char('\n');
|
text.replace(QLatin1Char('\n'), QChar::LineSeparator);
|
||||||
for (int i = 0; i < text.count(); ++i)
|
|
||||||
if (text.at(i) == nl)
|
|
||||||
text[i] = QChar::LineSeparator;
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user