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:

  1. populate list 100 items
  2. view scrolled down (by user) bottom
  3. 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:

  1. get qscrollbar object used qlistview calling verticalscrollbar().
  2. connect slidermoved(int value) signal of scroll bar slot of choice.
  3. in slot, fetch min/max values of scroll bar , compare them value given in signal.

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -