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 Updated to NodeBB v4.3 + New Features

How to understand logical DPI and physical DPI in QScreen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qscreen
6 Posts 4 Posters 2.9k 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.
  • W Offline
    W Offline
    willxli
    wrote on 8 Apr 2021, 12:29 last edited by willxli 4 Aug 2021, 12:40
    #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.

    R P 2 Replies Last reply 8 Apr 2021, 12:34
    0
    • W willxli
      8 Apr 2021, 12:29

      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.

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 8 Apr 2021, 12:34 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 8 Apr 2021, 12:41
      3
      • R raven-worx
        8 Apr 2021, 12:34

        @willxli
        read the docs or precise your question

        W Offline
        W Offline
        willxli
        wrote on 8 Apr 2021, 12:41 last edited by
        #3

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

        R 1 Reply Last reply 8 Apr 2021, 13:04
        0
        • W willxli
          8 Apr 2021, 12:41

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

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 8 Apr 2021, 13:04 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
            8 Apr 2021, 12:29

            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.

            P Offline
            P Offline
            Pl45m4
            wrote on 8 Apr 2021, 13:10 last edited by Pl45m4 4 Aug 2021, 13:36
            #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 9 Apr 2021, 09:02 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

              3/6

              8 Apr 2021, 12:41

              • Login

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