Skip to content

Add ChainModel #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed

Add ChainModel #40

wants to merge 16 commits into from

Conversation

promag
Copy link
Contributor

@promag promag commented Sep 28, 2021

Based on #38. This PR adds and uses the ChainModel. This model exposes chain data, like block heights and hashes. Can be used as a source for list views and repeaters. The model uses a lazy load approach, ie, data is fetched from interfaces::Chain as needed.

@promag promag changed the title 2021 09 chainmodel Add ChainModel Sep 28, 2021

void ChainModel::fetchMore(const QModelIndex& parent)
{
auto& chain = Engine::chain(this);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add qDebug() << Q_FUNC_INFO; while testing (scrolling the list) to see how lazy loading works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanofsky using interfaces::Chain here.


ListView {
anchors.fill: parent
model: ChainModel {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanofsky this is a dumb example, but the idea is to access block details.


void ChainModel::fetchMore(const QModelIndex& parent)
{
auto& chain = Engine::chain(this);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanofsky using interfaces::Chain here.

@jarolrod
Copy link
Member

Concept ACK, we're going to need to expose more than just the nodemodel to qml. One big backend object would be quite a mess. All that's needed is good documentation of what is exposed to qml and why.

@promag promag closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants