From 27e9a474a8c205829067a017f7d7fbde0891c42a Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 25 Mar 2014 00:15:47 +0100 Subject: [PATCH] QTreeView::dataChanged() signature changed in Qt5 --- src/uisupport/bufferview.cpp | 7 ++++++- src/uisupport/bufferview.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 4c09a46b..167d6b99 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -392,10 +392,15 @@ void BufferView::setExpandedState(const QModelIndex &networkIdx) storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state } - +#if QT_VERSION < 0x050000 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { QTreeView::dataChanged(topLeft, bottomRight); +#else +void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) +{ + QTreeView::dataChanged(topLeft, bottomRight, roles); +#endif // determine how many items have been changed and if any of them is a networkitem // which just swichted from active to inactive or vice versa diff --git a/src/uisupport/bufferview.h b/src/uisupport/bufferview.h index 8a576640..1c0c52ec 100644 --- a/src/uisupport/bufferview.h +++ b/src/uisupport/bufferview.h @@ -76,12 +76,17 @@ protected: virtual void keyPressEvent(QKeyEvent *); virtual void dropEvent(QDropEvent *event); virtual void rowsInserted(const QModelIndex &parent, int start, int end); - virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); virtual void wheelEvent(QWheelEvent *); virtual QSize sizeHint() const; 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); void toggleHeader(bool checked); -- 2.20.1