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

non-square pixel

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 741 Views 1 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.
  • F Offline
    F Offline
    FStein
    wrote on last edited by
    #1

    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!

    jsulmJ 1 Reply Last reply
    0
    • F FStein

      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!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      0
      • jsulmJ jsulm

        @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.

        F Offline
        F Offline
        FStein
        wrote on last edited by
        #3

        @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!

        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