non-square pixel
-
I am just starting out with QT and QML and the screen I am usign doesn't have square pixels. This results in all UI elements being slightly stretched. Is there a way to handle this globally?
Thanks!
-
@FStein I doubt your problem is related to the fact that the pixels are not square. Non square pixels are quite normal as far as I know. My guess is that you set a resolution which is not native resolution of your screen.
@jsulm Thanks for your input. I am certain that the resolution is set correctly, other content is displayed without distortion. In my qml I have a rectangle that is 200x200 in size. On the display it is not square. It is distorted by the aspect ratio of the pixels.
My display has an active area of 154.08mm x 57.28mm. With the resolution of 800pxx320px it means that the pixels are 0,1926mm x 0,179mm in size. If I scale the aforementioned square by a factor of 1,075977654 (0,1926/0,179) the result is a square with the right edge lengths on the screen.I guess it comes down to the display not being a standard aspect ratio.
I can work around the issue by scaling all the elements in my qml, but that is not the ideal way, I guess.
I also have set these environment variables:
QT_QPA_EGLFS_PHYSICAL_WIDTH=154
QT_QPA_EGLFS_PHYSICAL_HEIGHT=57
Unfortunately, they have no effect on the displayed image.If anyone has suggestion on how to approach this, let me know.
Thanks!