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. How to understand logical DPI and physical DPI in QScreen?
Forum Update on Monday, May 27th 2025

How to understand logical DPI and physical DPI in QScreen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qscreen
6 Posts 4 Posters 2.8k 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.
  • W Offline
    W Offline
    willxli
    wrote on last edited by willxli
    #1

    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-worxR Pl45m4P 2 Replies Last reply
    0
    • W 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-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @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
      3
      • raven-worxR raven-worx

        @willxli
        read the docs or precise your question

        W Offline
        W Offline
        willxli
        wrote on last edited by
        #3

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

        raven-worxR 1 Reply Last reply
        0
        • W willxli

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

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @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
          1
          • W 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.

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by Pl45m4
            #5

            @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
            1
            • S Offline
              S Offline
              SimonSchroeder
              wrote on last edited by
              #6

              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
              1

              • Login

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