Skip to content

Fix the layout of Qt models #225

@stdevCrow

Description

@stdevCrow

Feature description
There are not relationship between models and what should be its submodels, in most cases. For example, there are no relationship between the model of wallets and the model of addresses.

Is your feature request related to a problem? Please describe.
Indeed, its hard to have a centralized way to update/add/remove everything if we have so much independent models.
Everybody that worked in QML models should take a look in their respective model(s) and check if this is done.

Describe the solution you'd like
I will describe the solution I'd like with the models of wallets as an example:

The hierarchy should be the following:

ModelOfWallets
| - CollectionOfWallets
|   | - SingleWallet # 1
|   |   | - ModelOfAddresses
|   |   |   | - CollectionOfAddresses
|   |   |   |   | - SingleAddress # 1
|   |   |   |   | - SingleAddress # 2
|   | - SingleWallet # 2
|   ... ... ... ...
...

Resuming...
The model of addresses shouldn't be independent of the model of wallets. Every wallet of the model of wallets should contain (composition) a model of addresses, and the model of addresses must be exposed as a role to QML.
The same idea applies to the remaining Qt models.

Describe alternatives you've considered
None, but we're open to ideas...

Additional context
None.

Possible implementation
Check this: https://github.com/lateo96/embedded-models

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions