inline QTextLayout *layout() const;
+ virtual QTextLayout::FormatRange selectionFormat() const;
virtual inline QVector<QTextLayout::FormatRange> additionalFormats() const { return QVector<QTextLayout::FormatRange>(); }
+
qint16 posToCursor(const QPointF &pos);
inline bool hasPrivateData() const { return (bool)_data; }
_boundingRect.setWidth(width);
_boundingRect.setHeight(height);
}
- inline void setHeight(const qreal &height) { _boundingRect.setHeight(height); }
- inline void setWidth(const qreal &width) { _boundingRect.setWidth(width); }
+ inline void setHeight(const qreal &height) {
+ _boundingRect.setHeight(height);
+ }
+ inline void setWidth(const qreal &width) {
+ _boundingRect.setWidth(width);
+ }
private:
// internal selection stuff
virtual inline ChatLineModel::ColumnType column() const { return ChatLineModel::SenderColumn; }
protected:
- virtual inline ChatItemPrivate *newPrivateData() { return new ChatItemPrivate(createLayout(QTextOption::WrapAnywhere, Qt::AlignRight)); }
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ virtual inline ChatItemPrivate *newPrivateData() { return new ChatItemPrivate(createLayout(QTextOption::ManualWrap, Qt::AlignRight)); }
};
// ************************************************************
void showWebPreview(const Clickable &click);
void clearWebPreview();
-
- // WARNING: setGeometry and setHeight should not be used without either:
- // a) calling prepareGeometryChange() immediately before setColumns()
- // b) calling Chatline::setPos() immediately afterwards
qreal setGeometryByWidth(qreal w);
friend class ChatLine;
friend struct ContentsChatItemPrivate;
ContentsChatItem::Clickable currentClickable;
bool hasDragged;
- ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
+ ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent)
+ : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
};
//inlines regarding ContentsChatItemPrivate