-
As an attempt to generate a grid of cells, I've tried the following : for index in 64: Rectangle {
background: mod(mod(index, 8) + (index / 8), 2) == 0 ? #FFDEAD : #CD853F;
width: size * 0.111px;
height: size * 0.111px;
} But it seems I'm missing a way to position all those cells. Furthermore, I'm using a single loop, where two nested loops would help much more. So is it possible to do this ? |
Beta Was this translation helpful? Give feedback.
Answered by
ogoffart
Sep 2, 2022
Replies: 1 comment 1 reply
-
You can use the Example: for index in 64: Rectangle {
background: mod(mod(index, 8) + (index / 8), 2) == 0 ? #FFDEAD : #CD853F;
width: size * 0.111px;
height: size * 0.111px;
x: width * mod(index, 8);
y: height * floor(index/8);
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
loloof64
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
x
andy
properties to position elements that are not in a layout.Example:
demo