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
parent
d0e93b128d
commit
72f700edd6
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in New Issue