X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fbufferview.h;h=47a519f5a48a9a8c992591f1b084d8af6bb2ea23;hb=af9bfa0581dd3620f6fe300084262c55c7084046;hp=2bd122126729539c89271896545908aeee8f78ec;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 2bd12212..47a519f5 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -68,7 +68,10 @@ public slots: void nextBuffer(); void previousBuffer(); void hideCurrentBuffer(); - void filterTextChanged(QString filterString); + void filterTextChanged(const QString& filterString); + void changeHighlight(Direction direction); + void selectHighlighted(); + void clearHighlight(); signals: void removeBuffer(const QModelIndex &); @@ -82,11 +85,7 @@ protected: virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); } virtual void contextMenuEvent(QContextMenuEvent *event); -#if QT_VERSION < 0x050000 - virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); -#else virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles); -#endif private slots: void joinChannel(const QModelIndex &index); @@ -132,11 +131,12 @@ private: WasActive = 0x02 }; QHash _expandedState; + QModelIndex _currentHighlight; }; // ****************************** -// BufferViewDelgate +// BufferViewDelegate // ****************************** class BufferViewDelegate : public QStyledItemDelegate @@ -145,10 +145,15 @@ class BufferViewDelegate : public QStyledItemDelegate public: BufferViewDelegate(QObject *parent = 0); - bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index); + bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override; + + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + +public: + QModelIndex currentHighlight; protected: - virtual void customEvent(QEvent *event); + void customEvent(QEvent *event) override; };