woboq / qmetaobject-rs

Integrate Qml and Rust by building the QMetaObject at compile time.
MIT License
638 stars 89 forks source link

QAbstractItemModel/QAbstractListModel: canFetchMore and fetchMore #98

Open rubdos opened 4 years ago

rubdos commented 4 years ago

Hi!

I have a QAbstractListModel that I would want to populate asynchronously (or lazily, as far as Qt is concerned) through QAbstractItemModel::canFetchMore and QAbstractItemModel::fetchMore. These are not exposed as far as I can tell in this crate.

Now, I would be prepared to implement this and get a PR out here, but I'm uncertain how to proceed. listmodel.rs has quite a few statements like

// FIXME! code duplication with impl QAbstractItemModel

... and "just" naively implementing these methods would make things (much) worse: duplicated code across ItemModel and ListModel + default implementations that are the same in both and in Qt. Maybe this code duplication should be fixed first?

I'm interested in hearing your thoughts about this! Maybe you're also interested in reading this little proof of concept that I made last month, and while tangentially related, it's probably food for another issue.

ogoffart commented 4 years ago

Hi @rubdos Your contribution would be welcome. Fixing the code duplication would be really nice. But i'd also accept it if it doesn't do that yet.

ratijas commented 4 years ago

Maybe you're also interested in reading this little proof of concept that I made last month

Truly interesting. I've been experimenting with Sailfish OS during university course. Wonderful and terribly underestimated piece of mobile technology.

rubdos commented 4 years ago

Truly interesting. I've been experimenting with Sailfish OS during university course. Wonderful and terribly underestimated piece of mobile technology.

Oh wait, what university uses SailfishOS in what context? If you'd like to chat with me about this, please join me on Matrix (#whisperfish:rubdos.be / @rubdos:rubdos.be) /mail/IRC, I'm truly interested in the context of that statement, since I'm teaching at a university in Brussels. Any excuse to have Sailfish on the job is a good one!