Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. GridView and fetchmore

GridView and fetchmore

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 244 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    naccyde
    wrote on last edited by
    #1

    Hi!

    I'm writing an app that should display a huge amount of pictures. I subclassed QAbstractListModel in order to load and store the pictures (this class also acts as a QQuickImageProvider). So I'm able to load my images fine from a given folder.

    I want to display all these images inside a GridView, but on start, the model tries to load all the pictures available in a folder. If the folder contains a lot of files, it slows done the application's UI. I found out about canFetchMore() and fetchMore() that I implemented inside my model. Unfortunately, it looks like GridView doesn't call these functions when you scroll down to the end of the view.

    So far, my model is created on application startup, it then loads a limited amount of pictures using QtConcurrent::run(), which then emit a signal connected to the model to update the picture's list (calling beginInsertRows() and endInsertRows()). On UI side, the GridView perfectly displays the pictures loaded in the model, but I expect it to call canFetchMore() on the model, which it doesn't.

    Did I missed something?

    Thank you!

    1 Reply Last reply
    0
    • N Offline
      N Offline
      naccyde
      wrote on last edited by
      #2

      Solved! It looks like canFetchMore() and fetchMore() are not called be QML's ListView and GridView on Qt 5.12.4 on Fedora 31. Installing Qt 5.13.1 using the Online Installer provided by Qt fixed it!

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved