+QVariant ChatLineModelItem::contentsData(int role) const {
+ if(_styledMsg.needsStyling())
+ _styledMsg.style(QtUi::style());
+
+ switch(role) {
+ case ChatLineModel::DisplayRole:
+ case ChatLineModel::EditRole:
+ return _styledMsg.plainContents();
+ case ChatLineModel::FormatRole:
+ return QVariant::fromValue<UiStyle::FormatList>(_styledMsg.contentsFormatList());
+ case ChatLineModel::WrapListRole:
+ if(_wrapList.isEmpty())
+ computeWrapList();
+ return QVariant::fromValue<ChatLineModel::WrapList>(_wrapList);
+ }
+ return QVariant();