c++ - How to determine when at the bottom / end of a QListView? -
i'm using qlistview
wraps simple list model. try implementing similar "infinite scroll" seen in web pages.
currently model updated method adds @ 100 items (they're taken external web api takes @ 100 items per call). goal: when user moves last element of list view (in case, scrolling down) start call 100 more items, , on.
to simplify in example:
- populate list 100 items
- view scrolled down (by user) bottom
- other 100 items fetched.
is there in qlistview
tells me when i'm @ end of visible view?
qlistview
subclass of qabstractscrollarea
, 1 way of finding out if vertical scroll bar's position @ 1 of extremes to:
- get
qscrollbar
object usedqlistview
callingverticalscrollbar()
. - connect
slidermoved(int value)
signal of scroll bar slot of choice. - in slot, fetch min/max values of scroll bar , compare them value given in signal.
Comments
Post a Comment