tst_qidentityproxymodel: map the index to the source model

In data(), index belongs to the proxy, not to the source. It needs
to be mapped back to it first.

Change-Id: Ie5dcbf13166dadf62f3d85b594d3227383132521
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
bb10
Giuseppe D'Angelo 2017-09-01 18:48:14 +02:00
parent d0e93b128d
commit 72f700edd6
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,7 @@ class AppendStringProxy : public QIdentityProxyModel
public:
QVariant data(const QModelIndex &index, int role) const
{
const QVariant result = sourceModel()->data(index, role);
const QVariant result = QIdentityProxyModel::data(index, role);
if (role != Qt::DisplayRole)
return result;
return result.toString() + "_appended";