- SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
- inline virtual QRectF boundingRect() const { return _boundingRect; }
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+ SearchHighlightItem(QRectF wordRect, QGraphicsItem* parent = nullptr);
+ inline QRectF boundingRect() const override { return _boundingRect; }
+ void updateGeometry(qreal width, qreal height);
+ void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
+ enum
+ {
+ Type = ChatScene::SearchHighlightType
+ };
+ inline int type() const override { return Type; }
+
+ void setHighlighted(bool highlighted);
+
+ static bool firstInLine(QGraphicsItem* item1, QGraphicsItem* item2);
+
+private slots:
+ void updateHighlight(qreal value);