Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. need ideas: how do YOU handle support for multiple resolution
QtWS25 Last Chance

need ideas: how do YOU handle support for multiple resolution

Scheduled Pinned Locked Moved Solved Brainstorm
3 Posts 2 Posters 448 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mzimmers
    wrote on 1 Dec 2022, 17:43 last edited by
    #1

    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...

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TomZ
      wrote on 2 Dec 2022, 17:51 last edited by
      #2

      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.

      M 1 Reply Last reply 5 Dec 2022, 19:50
      1
      • T TomZ
        2 Dec 2022, 17:51

        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.

        M Offline
        M Offline
        mzimmers
        wrote on 5 Dec 2022, 19:50 last edited by
        #3

        @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...

        1 Reply Last reply
        0

        1/3

        1 Dec 2022, 17:43

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved