X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.h;h=7bfd6eb0b96df426d378c8133ff9a30c10433f1d;hp=9d8a5651e00b433b791cb5df2613639a4ec548ee;hb=65118437813c853cbcc52f0c1a061457e264ed1a;hpb=206ce9444661cc7b2f65bdd8c8c0d1c365e6306f diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index 9d8a5651..7bfd6eb0 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -36,7 +36,7 @@ class ChatScene : public QGraphicsScene { Q_OBJECT public: - ChatScene(QAbstractItemModel *model, QObject *parent); + ChatScene(QAbstractItemModel *model, const QString &idString, QObject *parent); virtual ~ChatScene(); Buffer *buffer() const; @@ -45,22 +45,36 @@ class ChatScene : public QGraphicsScene { public slots: void setWidth(qreal); - private slots: - void rectChanged(const QRectF &); + // these are used by the chatitems to notify the scene + void setSelectingItem(ChatItem *item); + ChatItem *selectingItem() const { return _selectingItem; } + void startGlobalSelection(ChatItem *item); signals: void heightChanged(qreal height); + protected: + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); + virtual void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent); + protected slots: void rowsInserted(const QModelIndex &, int, int); + private slots: + void rectChanged(const QRectF &); + void handlePositionChanged(qreal xpos); + private: + QString _idString; qreal _width, _height; QAbstractItemModel *_model; QList _lines; ColumnHandleItem *firstColHandle, *secondColHandle; qreal firstColHandlePos, secondColHandlePos; + + ChatItem *_selectingItem; }; #endif