I just realized that setting rowSpacing and columnSpacing values to 10 for the GridLayout ends up making medium tiles take up 150 width (70*2 for the small tiles as the primary cell size = 140 + 10 for spacing = 150), etc.
This also probably helps with the wide tiles, as there are three empty vertical lines below a wide tile if there's a row of small tiles under them. 70*4 is 280, but we still have to add up those spaces. If we do that, we get 30, so 280 + 30 = 310.
The documentation says that GridLayout uses the flow layout, so it should be just fine. I'll have to switch to that if it ends up working for me better than the flow layout I'm using now. That would be nice, because then we can set the number of columns and the tile layout won't change when rotating the phone or resizing the window.
Maybe I'll have to use Grid instead, not sure. I hope this is possible and works better than what I'm doing now. Couldn't find anything about setting a specific cell width and height in the docs. TableView has that, but doesn't seem to have column and row span.
I think I might be able to use the GridLayout and put each tile into a 70x70 Item, then change the tile's RowSpan and ColumnSpan when resizing them. Or maybe, each tile would just be 70x70 and only the RowSpan and ColumnSpan would change, I don't know.
I'll be using the TilesGrid component I found before. Need to merge it with my code.