GridView and fetchmore



  • 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!



  • 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!



  • 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!


Log in to reply