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

Non-square pixel TFT and QML

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 3 Posters 434 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
    Landolfi
    wrote on last edited by
    #1

    I have a 800x480 TFT with rectangular pixels (0.19x0.18mm). When I draw a circle I get an oval.
    I'm using Yocto on a AM62 SOM with in eglfs mode.
    With widget app, I can set the window size to 851x480: since the window is forced full screen by eglfs, that 851 points are stretched in 800 pixels correcting the image aspect ratio.
    With QML I cannot change the window size: the resize method has no effect, the size is always 800x480.
    Please help.IMG_5139.jpg

    1 Reply Last reply
    0
    • TomZT Offline
      TomZT Offline
      TomZ
      wrote on last edited by
      #2

      you want to look at scaling.

      Item {
        id: scalingItem
        anchors.fill: parent
         transform: Scale { yScale: 19/18}
        Rectangle {
          width: 100
           height: 100
           radius: 50
           color: 'red"
        }
      }
      

      Untested, I hope you can get the idea.

      L 1 Reply Last reply
      0
      • TomZT TomZ

        you want to look at scaling.

        Item {
          id: scalingItem
          anchors.fill: parent
           transform: Scale { yScale: 19/18}
          Rectangle {
            width: 100
             height: 100
             radius: 50
             color: 'red"
          }
        }
        

        Untested, I hope you can get the idea.

        L Offline
        L Offline
        Landolfi
        wrote on last edited by
        #3

        @TomZ
        Yes, that is the solution. It was also my first idea but for some reason I didn't make it work the first time, so I spent 3 days looking for other ways, from kernel to textures.
        For anyone else having this kind of problem:

        Item {
            anchors.fill: parent
            transform: Scale { yScale: 1.065} //inverse of pixel ratio
        
            Item {
                id: mainQml
                width: 800; height: 451 //=480/1.065
        
        Ronel_qtmasterR 1 Reply Last reply
        0
        • L Landolfi has marked this topic as solved on
        • L Landolfi

          @TomZ
          Yes, that is the solution. It was also my first idea but for some reason I didn't make it work the first time, so I spent 3 days looking for other ways, from kernel to textures.
          For anyone else having this kind of problem:

          Item {
              anchors.fill: parent
              transform: Scale { yScale: 1.065} //inverse of pixel ratio
          
              Item {
                  id: mainQml
                  width: 800; height: 451 //=480/1.065
          
          Ronel_qtmasterR Offline
          Ronel_qtmasterR Offline
          Ronel_qtmaster
          wrote on last edited by
          #4

          @Landolfi how did you added your display to yocto?

          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