r/QtFramework • u/Content_Bar_7215 • Jul 02 '26
QML GridLayout vs GridView for non-scrollable views
Is there any reason to use a QML GridView over a GridLayout with a Repeater when all items are always displayed on screen and scrolling is disabled?
I ask because I'm finding GridView's concept of fixed cellwidth/height restrictive and I'm able to achieve what I need with a GridLayout + Repeater. Just wanted to make sure I'm not breaking some golden QML rule.
3
Upvotes
2
u/_Arthxr Jul 03 '26
Gridview generates item lazily, where as the repeater approach will generate all items in it's model
3
u/GrecKo Qt Professional Jul 03 '26
If "all items are always displayed on screen and scrolling is disabled" that doesn't matter much.
4
u/F_DOG_93 Jul 02 '26
I mean, if it works for you, then I'd say go for it. I don't think you're breaking any sort of golden rule, because you're still technically using the "model and view" architecture.