Qt Forum

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

    Unsolved How to understand logical DPI and physical DPI in QScreen?

    General and Desktop
    qscreen
    4
    6
    1125
    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.
    • W
      willxli last edited by willxli

      Hi all:
      I can't understand some concepts in QScreen.

      What is logical DPI and physical DPI ?
      What is difference between logical DPI and physical DPI ?

      Please give some hints, Thank you.

      raven-worx Pl45m4 2 Replies Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @willxli last edited by

        @willxli
        read the docs or precise your question

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        W 1 Reply Last reply Reply Quote 3
        • W
          willxli @raven-worx last edited by

          @raven-worx I update the question, thank you for reply.

          raven-worx 1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @willxli last edited by

            @willxli said in How to understand logical DPI and physical DPI in QScreen?:

            @raven-worx I update the question, thank you for reply.

            in my opinion you didnt read the docs nor you rewrote your question to be more precise :)

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 1
            • Pl45m4
              Pl45m4 @willxli last edited by Pl45m4

              @willxli said in How to understand logical DPI and physical DPI in QScreen?:

              What is logical DPI and physical DPI ?

              Physical DPI:
              DPI of your screen/device

              Logical DPI:
              Appearance of your font or anything you display.

              • https://doc.qt.io/qt-5/qscreen.html#details

              Let's say you have a line with a length of 3px (3x1)... and it actually takes 3 physical pixels of "space" on your screen. If you double your avaiable physical pixels, your line and anything else would appear way smaller on the screen (-> resolution). Therefore you need to map logical pixels of your content to correct pixels of your screen (new width and height).
              To stay with the example of a 3px line... If you double your physical pixels, you need to increase the logical pixels the line takes from 3 to 6 to make it look the same.
              [Edit: You don't increase the logical pixels.. You just map the 3 (3x1) logical pixels to 6 (6x2) physical pixels of your new screen]

              I hope this is understandable... Correct me if I said something wrong here :)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              1 Reply Last reply Reply Quote 1
              • S
                SimonSchroeder last edited by

                If I am not mistaken the relation between the physical and logical pixels is the scaling factor (usually set by the operating system). For example, Apple's Retina displays usually have a scaling of 200%. Which means that for every logical pixel there are 2 physical pixels (actually 2 in x- and y-direction each; which makes 4 in total) inside your display.

                You should try to change the scaling in your OS and then write a small toy program to see what physical and logical DPI you get. The physical DPI should be fixed.

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