[Interest] model/view: fetchMore with a QSortFilterProxyModel

Frank Rueter | OHUfx frank at ohufx.com
Fri Sep 2 07:30:27 CEST 2016


Hi all,

I'm implementing a model using fetchMore, to retrieve data from a model 
on demand, which in my case means the model fetches more data as the 
user scrolls down a QListView.
Technically this works just fine, except that the scrollbar adjusts it's 
width every time it hits the bottom, to accommodate the increase in 
rowCount.
I suppose I need to re-implement some methods to take over control of 
the view's verticalScrollbar(), but I'm not quite sure how.
I suspect I should use the view's resizeEvent to set a static range for 
my scrollbar, but I also need to make it stop adjust itself every time 
fetchMore is called by the model.
Has anybody ever done this?

Also, and more importantly, is anybody aware of examples that show the 
use of a QAbstractListModel (or QAbstractItemModel in general) which 
deploys the fetchMore logic along a QSortFilterProxyModel?
Currently my filter results are quite unexpected after implementing 
fetchMore and I'm not quite sure where to start to fix this. Should I 
implement the fetchMore method on the proxy model rather than the source 
model?
I can't find any documentation or examples about this.

Any pointers would be much appreciated.

Cheers,
frank

-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160902/a1f3ba99/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ohufxLogo_50x50.png
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160902/a1f3ba99/attachment.png>


More information about the Interest mailing list