Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
QtWS25 Last Chance

EGLFS: Unable to query physical screen size, defaulting to 100 dpi.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
9 Posts 4 Posters 12.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.
  • L Offline
    L Offline
    luca
    wrote on last edited by luca
    #1

    Hi all,
    I have a Qt Quick application on a BeagleBone Black board using EGLFS.
    It's connected to a TV using HDMI and it works fine.I can see to the monitor what I expect.

    The doubt is that when launching the application I get the message:

    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    

    I know (from other posts) that I can solve by setting the two env var as described on the message.

    My question is:
    What's the "real" effect of leaving the variables unsetted?
    Does it means that the "screen" works at lower resolution?

    Thanks

    1 Reply Last reply
    0
    • U Offline
      U Offline
      UPSNAIL
      wrote on last edited by
      #2

      I have same situation on my raspberry ,but my application work on fullscreen and don't have exit button. Do you have this phenomenon.if you have the same problem,could you give me you resolution.thanks

      1 Reply Last reply
      0
      • sneubertS Offline
        sneubertS Offline
        sneubert
        wrote on last edited by
        #3

        @luca
        The physical screen size has an impact on the size of visual items. A font size for example can be set with setPointSize. The actual pixelSize of this font depends on the display device pixel density.
        If you have screen A with 1920x1080 pixel and 19 Inch and screen B with 1920x1080 pixel but 15 Inch, a 20pt font pixelSize on B is greater than on screen A, resulting in the font beeing displayed on both screens at the same physical size.

        If you get the message

        Unable to query physical screen size, defaulting to 100 dpi.
        To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
        

        this tells you that your font (and other visual items) may be either bigger or smaller than a 20pt font on a display where the physical width and height are known, unless your display has 100dpi.

        In short, if you don´t plan to run your application on screens with different dpi and the appearance suits your needs,
        you can ignore it. It will also run on screens with lower resolution but maybe with a different size.

        @UPSNAIL
        I guess your application is running on eglfs plugin, so there´s no window manager and therefore no window decoration with exit button.

        L U 2 Replies Last reply
        3
        • sneubertS sneubert

          @luca
          The physical screen size has an impact on the size of visual items. A font size for example can be set with setPointSize. The actual pixelSize of this font depends on the display device pixel density.
          If you have screen A with 1920x1080 pixel and 19 Inch and screen B with 1920x1080 pixel but 15 Inch, a 20pt font pixelSize on B is greater than on screen A, resulting in the font beeing displayed on both screens at the same physical size.

          If you get the message

          Unable to query physical screen size, defaulting to 100 dpi.
          To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
          

          this tells you that your font (and other visual items) may be either bigger or smaller than a 20pt font on a display where the physical width and height are known, unless your display has 100dpi.

          In short, if you don´t plan to run your application on screens with different dpi and the appearance suits your needs,
          you can ignore it. It will also run on screens with lower resolution but maybe with a different size.

          @UPSNAIL
          I guess your application is running on eglfs plugin, so there´s no window manager and therefore no window decoration with exit button.

          L Offline
          L Offline
          luca
          wrote on last edited by
          #4

          @sneubert Thanks for clarification!

          1 Reply Last reply
          0
          • L Offline
            L Offline
            luca
            wrote on last edited by
            #5

            Is it possible to set those variables by code (for example in the main.cpp) so that I can put them in the application QSettings ?

            1 Reply Last reply
            0
            • sneubertS sneubert

              @luca
              The physical screen size has an impact on the size of visual items. A font size for example can be set with setPointSize. The actual pixelSize of this font depends on the display device pixel density.
              If you have screen A with 1920x1080 pixel and 19 Inch and screen B with 1920x1080 pixel but 15 Inch, a 20pt font pixelSize on B is greater than on screen A, resulting in the font beeing displayed on both screens at the same physical size.

              If you get the message

              Unable to query physical screen size, defaulting to 100 dpi.
              To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
              

              this tells you that your font (and other visual items) may be either bigger or smaller than a 20pt font on a display where the physical width and height are known, unless your display has 100dpi.

              In short, if you don´t plan to run your application on screens with different dpi and the appearance suits your needs,
              you can ignore it. It will also run on screens with lower resolution but maybe with a different size.

              @UPSNAIL
              I guess your application is running on eglfs plugin, so there´s no window manager and therefore no window decoration with exit button.

              U Offline
              U Offline
              UPSNAIL
              wrote on last edited by
              #6

              @sneubert Thanks for your reply. Indeed ,my application is running on gelfs plugin,Do you have resolution to this phenomenon.when i run the application on linuxfb plugin,the application cannot work.Could you know why?I'm a chinese boy ,excuse my bad English.

              1 Reply Last reply
              0
              • sneubertS Offline
                sneubertS Offline
                sneubert
                wrote on last edited by
                #7

                @luca
                I´m not sure, if you can set this in your code, but there´s a section on this site http://doc.qt.io/qt-5/embedded-linux.html#eglfs-with-eglfs-kms-backend
                dealing with multiple screens and talking about physicalWidth and physicalHeight
                properties. Maybe that´s a starting point, or someone else can answer this.

                @UPSNAIL
                Do I get you right, that your problem is the missing quit button? If yes, linuxfb won´t
                solve this. You can run your application under xserver or wayland. With QtWayland compositor it is very easy to write your own window manager.
                I like this one http://blog.qt.io/blog/2017/01/23/creating-devices-with-multiple-ui-processes-using-wayland/
                take a look at the video at the bottom.

                U 1 Reply Last reply
                2
                • sneubertS sneubert

                  @luca
                  I´m not sure, if you can set this in your code, but there´s a section on this site http://doc.qt.io/qt-5/embedded-linux.html#eglfs-with-eglfs-kms-backend
                  dealing with multiple screens and talking about physicalWidth and physicalHeight
                  properties. Maybe that´s a starting point, or someone else can answer this.

                  @UPSNAIL
                  Do I get you right, that your problem is the missing quit button? If yes, linuxfb won´t
                  solve this. You can run your application under xserver or wayland. With QtWayland compositor it is very easy to write your own window manager.
                  I like this one http://blog.qt.io/blog/2017/01/23/creating-devices-with-multiple-ui-processes-using-wayland/
                  take a look at the video at the bottom.

                  U Offline
                  U Offline
                  UPSNAIL
                  wrote on last edited by
                  #8

                  @sneubert thanks you very much, i will try that.

                  A 1 Reply Last reply
                  0
                  • U UPSNAIL

                    @sneubert thanks you very much, i will try that.

                    A Offline
                    A Offline
                    amruz
                    wrote on last edited by
                    #9

                    @UPSNAIL did you succeed in this?
                    if yes kindly help me also
                    i am also having the same problem when trying to display a widget application in raspberry pi

                    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