From 54fabb964cd70de663d182be41440f390961c71c Mon Sep 17 00:00:00 2001 From: Binayak Ghosh Date: Sun, 28 Feb 2016 17:23:15 +0530 Subject: [PATCH] fixes issue #2868 --- src/widget/form/chatform.cpp | 2 +- src/widget/form/genericchatform.cpp | 2 +- src/widget/tool/croppinglabel.cpp | 3 ++- src/widget/widget.cpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index 31ae9cf9b..4fd3fb6fb 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -138,7 +138,7 @@ ChatForm::~ChatForm() void ChatForm::setStatusMessage(QString newMessage) { statusMessageLabel->setText(newMessage); - statusMessageLabel->setToolTip(newMessage.toHtmlEscaped()); // for overlength messsages + statusMessageLabel->setToolTip(Qt::convertFromPlainText(newMessage, Qt::WhiteSpaceNormal)); // for overlength messsages } void ChatForm::onSendTriggered() diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index 55a8a05fb..0f41c5a5f 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -272,7 +272,7 @@ QDate GenericChatForm::getLatestDate() const void GenericChatForm::setName(const QString &newName) { nameLabel->setText(newName); - nameLabel->setToolTip(newName.toHtmlEscaped()); // for overlength names + nameLabel->setToolTip(Qt::convertFromPlainText(newName, Qt::WhiteSpaceNormal)); // for overlength names } void GenericChatForm::show(ContentLayout* contentLayout) diff --git a/src/widget/tool/croppinglabel.cpp b/src/widget/tool/croppinglabel.cpp index 4d9e589db..c4c771b00 100644 --- a/src/widget/tool/croppinglabel.cpp +++ b/src/widget/tool/croppinglabel.cpp @@ -21,6 +21,7 @@ #include #include #include +#include CroppingLabel::CroppingLabel(QWidget* parent) : QLabel(parent) @@ -126,7 +127,7 @@ void CroppingLabel::setElidedText() { QString elidedText = fontMetrics().elidedText(origText, elideMode, width()); if (elidedText != origText) - setToolTip(origText.toHtmlEscaped()); + setToolTip(Qt::convertFromPlainText(origText, Qt::WhiteSpaceNormal)); else setToolTip(QString()); diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index d2677077e..2e8a04ebe 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -838,7 +838,7 @@ void Widget::setUsername(const QString& username) else { ui->nameLabel->setText(username); - ui->nameLabel->setToolTip(username.toHtmlEscaped()); // for overlength names + ui->nameLabel->setToolTip(Qt::convertFromPlainText(username, Qt::WhiteSpaceNormal)); // for overlength names } QString sanename = username; @@ -863,7 +863,7 @@ void Widget::setStatusMessage(const QString &statusMessage) else { ui->statusLabel->setText(statusMessage); - ui->statusLabel->setToolTip(statusMessage.toHtmlEscaped()); // for overlength messsages + ui->statusLabel->setToolTip(Qt::convertFromPlainText(statusMessage, Qt::WhiteSpaceNormal)); // for overlength messsages } }