Add Utils::String::toHtmlEscaped

This commit is contained in:
Chocobo1 2017-02-11 14:04:06 +08:00 committed by sledgehammer999
parent eba45a0b26
commit 6ca3e4f094
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
6 changed files with 21 additions and 8 deletions

View file

@ -211,3 +211,12 @@ bool Utils::String::slowEquals(const QByteArray &a, const QByteArray &b)
return (diff == 0);
}
QString Utils::String::toHtmlEscaped(const QString &str)
{
#ifdef QBT_USES_QT5
return str.toHtmlEscaped();
#else
return Qt::escape(str);
#endif
}