Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Windows touchscreen DPI scaling

Windows touchscreen DPI scaling

Scheduled Pinned Locked Moved Unsolved Qt 6
2 Posts 1 Posters 297 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.
  • B Offline
    B Offline
    bee65
    wrote on last edited by
    #1

    Anybody using Qt 6.2 on Windows with a high DPI touchscreen? I am getting a mix of scaled and unscaled coordinates when dragging with the touchscreen, resulting in jitter in objects dragged on the screen. The issue affects both MultiPointTouchArea and MouseArea, and doesn't occur in Qt 5.15.6

    Here is some very simple code to show the problem:

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        Rectangle {
            id : red_rect
            x: 0
            y: 0
            width: 100
            height: 100
            color:"red"
        }
    
    //    MultiPointTouchArea {
    //        anchors.fill: parent
    //        onTouchUpdated: function(touchPoints) {
    //            if (touchPoints.length === 1)
    //            {
    //                let p = touchPoints[0]
    //                console.log("Single touch at ", p.x, p.y)
    //                red_rect.x = p.x - 50
    //                red_rect.y = p.y - 50
    //            }
    //        }
    //    }
    
        MouseArea {
            anchors.fill: parent
            
            onPressed : function(mouse) {
                mouse.accepted = true;
            }
            
            onPositionChanged: function(mouse) {
                    let p = mouse
                    console.log("Mouse drag at ", p.x, p.y, "source=", mouse.source)
                    red_rect.x = p.x - 50
                    red_rect.y = p.y - 50
            }
        }
    }
    
    1 Reply Last reply
    0
    • B Offline
      B Offline
      bee65
      wrote on last edited by
      #2

      @bee65 said in Windows touchscreen DPI scaling:
      I found a bug report already on this: QTBUG-97185

      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