ContentsChatItem(const qreal &width, const QPointF &pos, QGraphicsItem *parent);
inline ChatLineModel::ColumnType column() const { return ChatLineModel::ContentsColumn; }
+ inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
protected:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
QList<Clickable> findClickables();
void endHoverMode();
+ void showWebPreview(const Clickable &click);
+ void clearWebPreview();
+
// WARNING: setGeometry and setHeight should not be used without either:
// a) calling prepareGeometryChange() immediately before setColumns()
friend class ChatLine;
friend struct ContentsChatItemPrivate;
- inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
QFontMetricsF *_fontMetrics;
};
};
struct ContentsChatItemPrivate : ChatItemPrivate {
+ ContentsChatItem *contentsItem;
QList<ContentsChatItem::Clickable> clickables;
ContentsChatItem::Clickable currentClickable;
bool hasDragged;
- ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c) : ChatItemPrivate(l), 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
ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); }
qint16 wordidx;
qint16 lineCount;
qreal choppedTrailing;
-// qint16 lastwrapcol;
-// qreal lastwrappos;
-// qreal width;
};
/*************************************************************************************************/