Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Qt UI design for the PinePhone?

    General and Desktop
    5
    9
    334
    Loading More Posts
    • 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.
    • P
      Publicnamer last edited by

      How can I adapt an existing Qt desktop application to also run suitably on the PinePhone, which runs various Linux distros?
      I assume I would need to detect the DPI and scale all graphics to some readable resolution.
      Two questions then:

      1. How to detect the current screen's DPI?
      2. How to scale all graphics in a window?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • M
        mattfbacon last edited by mattfbacon

        Have you tried it yet? Qt is pretty good at DPI scaling.

        P 1 Reply Last reply Reply Quote 0
        • A
          AnneRanch last edited by

          This post is deleted!
          SGaist 1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion @AnneRanch last edited by

            @AnneRanch please calm down.

            The question of @mattfbacon is pretty legitimate as it often happens that people start searching for screen related solutions before having tried to run their application on the target. Some application will require a redesign because interacting with a mobile phone screen is not the same as with a computer and some other time just recompiling is enough.

            So knowing what has been tried beforehand is better than starting to shot suggestions in the dark.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • P
              Publicnamer @mattfbacon last edited by

              @mattfbacon I don't have the phone yet. What is the API for DPI scaling in Qt?

              artwaw 1 Reply Last reply Reply Quote 0
              • artwaw
                artwaw @Publicnamer last edited by

                @Publicnamer https://doc.qt.io/qt-5/highdpi.html ?

                For more information please re-read.

                Kind Regards,
                Artur

                P 1 Reply Last reply Reply Quote 0
                • P
                  Publicnamer @artwaw last edited by

                  @artwaw Ideally Qt would read the system-wide settings e.g. if the font scaling adapts to 250 DPI then Qt would scale everything by 2.5X compared to a 100 DPI display. Looking at my Xfce based system I see that the DPI is stored in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml ... but I wonder if there is another place at Qt looks.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mattfbacon last edited by

                    My point is that worrying about scaling in Qt before trying it is a bit premature. For my Linux desktop, setting the environment variable QT_AUTO_SCREEN_SCALE_FACTOR to 1 worked like a charm, no application code required.

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      Publicnamer @mattfbacon last edited by

                      @mattfbacon I find that QT_SCALE_FACTOR=2 does an amazing job at scaling.
                      But I'm also wondering, is it real scaling at the pixel level, or is it just an OpenGL trick that makes that window bigger but the number of pixels in the window is unchanged?

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post