mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T190, improved display of text messages
* tooltip * using QStringBuilder
This commit is contained in:
@@ -81,5 +81,15 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
QVariant CTextMessageListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role == Qt::ToolTipRole)
|
||||
{
|
||||
// the underlying model object as summary
|
||||
const CTextMessage model(this->at(index));
|
||||
return model.asHtmlSummary("<br>");
|
||||
}
|
||||
return CListModelBase::data(index, role);
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -48,6 +48,9 @@ namespace BlackGui
|
||||
//! Mode
|
||||
TextMessageMode getTextMessageMode() const { return m_textMessageMode; }
|
||||
|
||||
//! \copydoc QAbstractItemModel::data
|
||||
virtual QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
private:
|
||||
TextMessageMode m_textMessageMode = NotSet;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user