Solved 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 aQQuickImageProvider
). 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 aboutcanFetchMore()
andfetchMore()
that I implemented inside my model. Unfortunately, it looks likeGridView
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 (callingbeginInsertRows()
andendInsertRows()
). On UI side, theGridView
perfectly displays the pictures loaded in the model, but I expect it to callcanFetchMore()
on the model, which it doesn't.Did I missed something?
Thank you!
-
Solved! It looks like
canFetchMore()
andfetchMore()
are not called be QML'sListView
andGridView
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()
andfetchMore()
are not called be QML'sListView
andGridView
on Qt 5.12.4 on Fedora 31. Installing Qt 5.13.1 using the Online Installer provided by Qt fixed it!