[Qt-interest] Accessing the source model of a QSortFilterProxyModel after filtering

Andreas Ntaflos daff at pseudoterminal.org
Fri May 8 05:26:12 CEST 2009


On Friday 08 May 2009 05:07:28 Bill KING wrote:
> Check out QAbstractProxyModel, especially mapTo/mapFrom functions.

Bill, 

thank you very much for the quick and very helpful reply! The call to 
mapToSource seems to be exactly what I needed:

QModelIndex index = _filterProxyModel->mapToSource(current);
qDebug() << _sourceModel->type(index); // Doesn't crash :)

Thanks a lot!

Andreas
-- 
Andreas Ntaflos 
Vienna, Austria 

GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC  7E65 397C E2A8 090C A9B4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2494 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090508/2c5bd920/attachment.bin 


More information about the Qt-interest-old mailing list