diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidgetItem.cpp | 6 | ||||
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidgetItem.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp index 9ba149e..2796c12 100644 --- a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp +++ b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp @@ -175,7 +175,7 @@ QVariant QtTreeWidgetItem::data(int role) { case Qt::DisplayRole: return displayName_; case Qt::TextColorRole: return textColor_; case Qt::BackgroundColorRole: return backgroundColor_; - case Qt::ToolTipRole: return isContact() ? displayName_ + ": " + statusText_ : QVariant(); + case Qt::ToolTipRole: return isContact() ? toolTipString() : QVariant(); case StatusTextRole: return statusText_; case AvatarRole: return avatar_; case PresenceIconRole: return getPresenceIcon(); @@ -183,6 +183,10 @@ QVariant QtTreeWidgetItem::data(int role) { } } +QString QtTreeWidgetItem::toolTipString() { + return displayName_ + "\n " + statusText_; +} + QIcon QtTreeWidgetItem::getPresenceIcon() { QString iconString; switch (statusShowType_) { diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.h b/Swift/QtUI/Roster/QtTreeWidgetItem.h index 8b69ae2..407bc9a 100644 --- a/Swift/QtUI/Roster/QtTreeWidgetItem.h +++ b/Swift/QtUI/Roster/QtTreeWidgetItem.h @@ -62,6 +62,7 @@ class QtTreeWidgetItem : public QObject, public TreeWidgetItem { private slots: void handleChanged(QtTreeWidgetItem* item); private: + QString toolTipString(); QList<QtTreeWidgetItem*> children_; QList<QtTreeWidgetItem*> shownChildren_; QtTreeWidgetItem* parent_; |