Treat \r and \n in comment fields as newlines

This commit is contained in:
David Sansome 2010-12-05 13:41:40 +00:00
parent cef02b4f61
commit 4c72ef4177
1 changed files with 3 additions and 0 deletions

View File

@ -214,6 +214,9 @@ bool PlaylistDelegateBase::helpEvent(QHelpEvent *event, QAbstractItemView *view,
// Special case: we want newlines in the comment tooltip
if (index.column() == Playlist::Column_Comment) {
text = Qt::escape(index.data(Qt::ToolTipRole).toString());
text.replace("\\r\\n", "<br />");
text.replace("\\n", "<br />");
text.replace("\r\n", "<br />");
text.replace("\n", "<br />");
}