need ideas: how do YOU handle support for multiple resolution
-
Hi all -
I'd really like to hear from experienced Qt people on ways to handle sizing objects in an app that will be run on devices with varying resolution. I'm very early in the development of an app that will need to do this, and I want to adopt a good practice for this early. Here's an example of what I'm currently doing:
property real tileWidth: (flickable.width - flickable.scrollerWidth - (equipmentGrid.tileSpacing * (nbrColumns + 1))) / nbrColumns
Effective but not exactly pretty code. It would be nice if the sizing of subordinate objects could be a little more...automatic.
Any suggestions for better ways to do this? I hope what I'm asking for makes sense.
Thanks...
-
Liberal usage of the Flow layout manager helps.
I would also say that you want to have widgets in their own classes (own QML files) and then for bigger differences in form-factor, you should consider simply making multiple QML layouts which each refer to those reusable QMLs.
Unless you are talking about nothing more complex than some screens being 20% bigger than others, you will not be able to make a nice UI that works for multiple form-factors anyway.
Not without lots little tweaks and calculations that make it impossible to debug your UI, anyway. -
@TomZ yeah, I think I won't have to accommodate huge resolution differences, maybe from 800x480 to 1280x800 or so. I've already taken the approach of using separate files for classes. Not sure the Flow layouts will work, but I'll look into it.
Thanks for the suggestions...