Skip to content
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

Use a custom model for relation editor form widget #3310

Open
wonder-sk opened this issue Apr 12, 2024 · 1 comment
Open

Use a custom model for relation editor form widget #3310

wonder-sk opened this issue Apr 12, 2024 · 1 comment
Labels
enhancement forms related to attribute forms relations

Comments

@wonder-sk
Copy link
Contributor

The relation editor form widget shows a couple of related features, with a button to show a full list ("N more") if not all related features can be shown. The current implementation uses Flow+Repeater and some logic to hide extra items (and count number of hidden items) if there are too many items. This is however a bit complicated, and it may be slow when there are many related features, because Repeater will create an item for each feature even if it is hidden. The idea is to move all this complexity to a custom item model that would be also responsible for layout decisions (it will need some basic visual parameters from QML - e.g. font metrics, number of rows, spacing). Such model should be then faster, easier to auto-test and QML code would be without much logic.

@tomasMizera
Copy link
Collaborator

tomasMizera commented Apr 12, 2024

++ we might consider if something like this should be used for the gallery too - I understand that ListView is smarter in instantiating delegates, but we will want to show only the first N features and then show x more too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement forms related to attribute forms relations
Projects
None yet
Development

No branches or pull requests

2 participants