Unable to query physical screen size
JasonS last edited by
I have an application that I have developed to run on the Raspberry Pi using their screen (https://www.raspberrypi.org/documentation/hardware/display/) and am running into some issues with UI control placement when I run it on the Pi. When developing the screens in QtQuick I have the window size specified as 800x480 so I would think the look and feel of the screens would look the same whether running locally from the IDE on my Mac and on the Pi. Everything looks fine on the Pi except for one screen where a gridlayout overlaps with other elements on the screen and doesn't when running it from the IDE on my Mac. I have a Ubuntu VM setup that I use for cross compiling to the Pi and when I run 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've found a couple of different posts that talk about this issue with various fixes that I have tried. One solution that seems to be consistent is that environment variables are added to .bashrc so I've tried adding the following variations:
QT_QPA_EGLFS_PHYSICAL_WIDTH=154 QT_QPA_EGLFS_PHYSICAL_HEIGHT=85 QT_QPA_EGLFS_WIDTH=800 QT_QPA_EGLFS_HEIGHT=480
I've also tried adding these variables to the kit I have setup in Qt Creator all with no success.
Any suggestions on what I can do to fix this or see my application/system is actually seeing for the screen dimensions?