GridLayout: implement support for nested for statements#10842
Open
dfaure-kdab wants to merge 2 commits intoslint-ui:masterfrom
Open
GridLayout: implement support for nested for statements#10842dfaure-kdab wants to merge 2 commits intoslint-ui:masterfrom
dfaure-kdab wants to merge 2 commits intoslint-ui:masterfrom
Conversation
This involved introducing a new way to access the caches (organization cache and coordinate cache), called GridRowCacheAccess, with two indices at runtime (row and column) instead of one. Since the common case is that all rows have the same amount of columns, the cache is based on that assumption, and the generated code ensures that this is always the case, taking the max() of all rows and adding "padding cells" where needed. This allows to do direct jumps in the 2D parts of the cache, without needing a per-row jump table. Fixes slint-ui#10670
Visually, it looks exactly like grid-with-repeated-rows.slint but the model is an array of arrays instead of being an array of structs.
51aa27d to
b5b41ec
Compare
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This involved introducing a new way to access the caches (organization cache and coordinate cache), called GridRowCacheAccess, with two indices at runtime (row and column) instead of one.
Since the common case is that all rows have the same amount of columns, the cache is based on that assumption, and the generated code ensures that this is always the case, taking the max() of all rows and adding "padding cells" where needed. This allows to do direct jumps in the 2D parts of the cache, without needing a per-row jump table.
Fixes #10670