_boundingRect(boundingRect),
_selectionMode(NoSelection),
_selectionStart(-1),
- _cachedLayout(0)
+ _cachedLayout(nullptr)
{
}
void ChatItem::clearCache()
{
delete _cachedLayout;
- _cachedLayout = 0;
+ _cachedLayout = nullptr;
}
using Label = UiStyle::MessageLabel;
using Format = UiStyle::Format;
- Label itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
+ auto itemLabel = data(ChatLineModel::MsgLabelRole).value<Label>();
const auto &fmtList = formatList();
struct LabelFormat {
ContentsChatItem::ContentsChatItem(const QPointF &pos, const qreal &width, ChatLine *parent)
: ChatItem(QRectF(pos, QSizeF(width, 0)), parent),
- _data(0)
+ _data(nullptr)
{
setPos(pos);
setGeometryByWidth(width);
void ContentsChatItem::clearCache()
{
delete _data;
- _data = 0;
+ _data = nullptr;
ChatItem::clearCache();
}
ContentsChatItemPrivate *ContentsChatItem::privateData() const
{
if (!_data) {
- ContentsChatItem *that = const_cast<ContentsChatItem *>(this);
+ auto *that = const_cast<ContentsChatItem *>(this);
that->_data = new ContentsChatItemPrivate(ClickableList::fromString(data(ChatLineModel::DisplayRole).toString()), that);
}
return _data;
qreal spacing = qMax(fontMetrics()->lineSpacing(), fontMetrics()->height()); // cope with negative leading()
qreal h = lines * spacing;
delete _data;
- _data = 0;
+ _data = nullptr;
if (w != width() || h != height())
setGeometry(w, h);
}
-ContentsChatItem::WrapColumnFinder::~WrapColumnFinder()
-{
-}
-
-
qint16 ContentsChatItem::WrapColumnFinder::nextWrapColumn(qreal width)
{
if (wordidx >= wrapList.count())