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 <faure@kde.org>
bb10
Stephen Kelly 2012-01-02 17:26:31 +01:00 committed by Qt by Nokia
parent 7023bb1d35
commit 17cc46a9a7
2 changed files with 7 additions and 7 deletions

View File

@ -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<int> &);
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<int> &)
{
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<int>)), this,
SLOT(_q_dataChanged(QModelIndex,QModelIndex,QSet<int>)));
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<int>)),
SLOT(_q_dataChanged(QModelIndex,QModelIndex,QSet<int>)));
connect(model, SIGNAL(destroyed()), SLOT(_q_modelDestroyed()));
}

View File

@ -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<int> &))
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())