TableView lazy load & Virtual Mode



  • I'm trying to display a lot of data in TableView.
    What I want is Lazy load with Virtual Mode in TableView.

    • Lazy Load (Or load on demand) : I want the TableView's model only store about 90 items (3 pages * 30 items)
      • When scroll down : The items about the View port will be remove & load more items at the end.
      • When scroll up : The items under the View port will be remove & load previous items at the begin.
    • Virtual Mode: I want the Scrollbar show
      • Max value : Total items in database (about 100,000)
      • Current value : The current "Virtual" scroll value regardless to the real TableView's model items (maximum is 90)
    • I'm tried to set rowCount => but it is readonly
    • I'm search for Virtual Mode but not a clue.
    • I'm think of custom the TableView but I don't know where to start (I'm a newbie with QT)

    PS: I'm use QT 5.4.2 MinGW

    Anyone can help me? Any sample or suggestion would be great !!!
    Many thanks !!!



  • If you use a QAbstractListModel the data() will be accessed on demand only (tested).
    TableView will reuse delegates when scrolling up/down and not create new ones (according to description)



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.