Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt UI design for the PinePhone?
Forum Updated to NodeBB v4.3 + New Features

Qt UI design for the PinePhone?

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 876 Views 3 Watching
  • 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 Offline
    P Offline
    Publicnamer
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      mattfbacon
      wrote on last edited by mattfbacon
      #2

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

      P 1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3
        This post is deleted!
        SGaistS 1 Reply Last reply
        0
        • A Anonymous_Banned275

          This post is deleted!

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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
          0
          • M mattfbacon

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

            P Offline
            P Offline
            Publicnamer
            wrote on last edited by
            #5

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

            artwawA 1 Reply Last reply
            0
            • P Publicnamer

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

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on last edited by
              #6

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

              For more information please re-read.

              Kind Regards,
              Artur

              P 1 Reply Last reply
              0
              • artwawA artwaw

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

                P Offline
                P Offline
                Publicnamer
                wrote on last edited by
                #7

                @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
                0
                • M Offline
                  M Offline
                  mattfbacon
                  wrote on last edited by
                  #8

                  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
                  0
                  • M mattfbacon

                    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 Offline
                    P Offline
                    Publicnamer
                    wrote on last edited by
                    #9

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

                    • Login

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