mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +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;
|
||||
};
|
||||
|
||||
@@ -119,6 +119,7 @@ namespace BlackGui
|
||||
this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
this->setWordWrap(true);
|
||||
this->setTextElideMode(Qt::ElideMiddle);
|
||||
|
||||
// shortcuts
|
||||
QShortcut *filter = new QShortcut(CShortcut::keyDisplayFilter(), this, SLOT(ps_displayFilterDialog()), nullptr, Qt::WidgetShortcut);
|
||||
|
||||
Reference in New Issue
Block a user