Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 6.1 Quick DragHandler Reporting Wrong Coordinates using TouchScreen Input
Forum Updated to NodeBB v4.3 + New Features

Qt 6.1 Quick DragHandler Reporting Wrong Coordinates using TouchScreen Input

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 499 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.
  • Q Offline
    Q Offline
    qtnewbie12345
    wrote on last edited by
    #1

    The following Qt 6.1 Quick program reports wrong x and y coordinate values using the TouchScreen Input.

    import QtQuick
    import QtQuick.Window
    
    Window {
        width: 1000
        height: 1000
        visible: true
    
        Text {
            text: handler.centroid.position.x.toFixed(1) + "," + handler.centroid.position.y.toFixed(1)
        }
    
        DragHandler {
            id: handler
            target:null
        }
    }
    

    When touching and untouching the screen report correct x and y coordinate, but while dragging wrong values are reported.
    It occurs under Windows 10 and when the display scaling is set to values other than 100%.
    For my instance, the display scaling is set to 200% and the value reported was twice the expected value.
    For example, I was touching x:300 y:300, but it was reporting x:600 y:600

    Other input methods such as mouse or stylus was OK.
    It seems that code for handling TouchScreen Input under HiDPI is buggy.

    Does anyone have similar issues? Or is there a setting to overcome this problem?

    R 1 Reply Last reply
    0
    • Q qtnewbie12345

      The following Qt 6.1 Quick program reports wrong x and y coordinate values using the TouchScreen Input.

      import QtQuick
      import QtQuick.Window
      
      Window {
          width: 1000
          height: 1000
          visible: true
      
          Text {
              text: handler.centroid.position.x.toFixed(1) + "," + handler.centroid.position.y.toFixed(1)
          }
      
          DragHandler {
              id: handler
              target:null
          }
      }
      

      When touching and untouching the screen report correct x and y coordinate, but while dragging wrong values are reported.
      It occurs under Windows 10 and when the display scaling is set to values other than 100%.
      For my instance, the display scaling is set to 200% and the value reported was twice the expected value.
      For example, I was touching x:300 y:300, but it was reporting x:600 y:600

      Other input methods such as mouse or stylus was OK.
      It seems that code for handling TouchScreen Input under HiDPI is buggy.

      Does anyone have similar issues? Or is there a setting to overcome this problem?

      R Offline
      R Offline
      RainerG
      wrote on last edited by
      #2

      @qtnewbie12345
      I observed the same issue on Windows with HDPI displays (scaling > 100%). It seems that the '(active)Translation.x/y' values are correct when the dragHandler activates but the finger is not moving - as soon as the finger moves, the reported translation values are scaled (and no longer relative to the first touch point). Did you report this as a bug? If not, I am happy to do that.

      J 1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtnewbie12345
        wrote on last edited by
        #3

        @RainerG
        I have not reported this as a bug. It will be great if you could report it for me.
        It still occurs on Qt 6.2. The phenomenon is exactly as you have described.
        Best Regards

        1 Reply Last reply
        0
        • R RainerG

          @qtnewbie12345
          I observed the same issue on Windows with HDPI displays (scaling > 100%). It seems that the '(active)Translation.x/y' values are correct when the dragHandler activates but the finger is not moving - as soon as the finger moves, the reported translation values are scaled (and no longer relative to the first touch point). Did you report this as a bug? If not, I am happy to do that.

          J Offline
          J Offline
          JSlyadne
          wrote on last edited by
          #4
          This post is deleted!
          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