This looks like a job for a proxy model. My knowledge level is not really good enough to rattle off an exact solution. Have a read of the QAbstractProxyModel documentation and a look at the browser demo's history handling models and this related QtLabs article.
Bookmarks