_boundingRect(boundingRect),
_selectionMode(NoSelection),
_selectionStart(-1),
- _cachedLayout(0)
+ _cachedLayout(nullptr)
{
}
void ChatItem::clearCache()
{
delete _cachedLayout;
- _cachedLayout = 0;
+ _cachedLayout = nullptr;
}
return LabelFormat{f.first, f.second, itemLabel};
});
// Append dummy element to avoid special-casing handling the last real format
- labelFmtList.push_back(LabelFormat{quint16(data(MessageModel::DisplayRole).toString().length()), {}, itemLabel});
+ labelFmtList.push_back(LabelFormat{quint16(data(MessageModel::DisplayRole).toString().length()), Format(), itemLabel});
// Apply the given label to the given range in the format list, splitting formats as necessary
auto applyLabel = [&labelFmtList](quint16 start, quint16 end, Label label) {
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();
}
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);
UiStyle::FormatList ContentsChatItem::formatList() const
{
UiStyle::FormatList fmtList = ChatItem::formatList();
- for (int i = 0; i < privateData()->clickables.count(); i++) {
+ for (size_t i = 0; i < privateData()->clickables.size(); i++) {
Clickable click = privateData()->clickables.at(i);
if (click.type() == Clickable::Url) {
overlayFormat(fmtList, click.start(), click.start() + click.length(), UiStyle::FormatType::Url);