From 17cc46a9a73a419619f2c13f26ef228325aa4a85 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 2 Jan 2012 17:26:31 +0100 Subject: [PATCH] Add the roles to the dataChanged slot. This will allow the possibility of ignoring dataChange signals for roles which are not interesting to particular widgets. Change-Id: Ia7dcebd875f7b9fa90aa5e9bff7ef5ca9f381d55 Reviewed-by: David Faure --- src/widgets/itemviews/qdatawidgetmapper.cpp | 12 ++++++------ src/widgets/itemviews/qdatawidgetmapper.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index 3574d63d1c..34699039c4 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -104,7 +104,7 @@ public: void populate(); // private slots - void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet &); void _q_commitData(QWidget *); void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint); void _q_modelDestroyed(); @@ -182,7 +182,7 @@ static bool qContainsIndex(const QModelIndex &idx, const QModelIndex &topLeft, && idx.column() >= topLeft.column() && idx.column() <= bottomRight.column(); } -void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) +void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet &) { if (topLeft.parent() != rootIndex) return; // not in our hierarchy @@ -369,8 +369,8 @@ void QDataWidgetMapper::setModel(QAbstractItemModel *model) return; if (d->model) { - disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, - SLOT(_q_dataChanged(QModelIndex,QModelIndex))); + disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QSet)), this, + SLOT(_q_dataChanged(QModelIndex,QModelIndex,QSet))); disconnect(d->model, SIGNAL(destroyed()), this, SLOT(_q_modelDestroyed())); } @@ -380,8 +380,8 @@ void QDataWidgetMapper::setModel(QAbstractItemModel *model) d->model = model; - connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - SLOT(_q_dataChanged(QModelIndex,QModelIndex))); + connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QSet)), + SLOT(_q_dataChanged(QModelIndex,QModelIndex,QSet))); connect(model, SIGNAL(destroyed()), SLOT(_q_modelDestroyed())); } diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h index 36b208529c..5ffb666fbd 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.h +++ b/src/widgets/itemviews/qdatawidgetmapper.h @@ -113,7 +113,7 @@ Q_SIGNALS: private: Q_DECLARE_PRIVATE(QDataWidgetMapper) Q_DISABLE_COPY(QDataWidgetMapper) - Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &)) + Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &, const QSet &)) Q_PRIVATE_SLOT(d_func(), void _q_commitData(QWidget *)) Q_PRIVATE_SLOT(d_func(), void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)) Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())