Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Touchscreen not working with any Qt based application. But it works fine with GTK ones.
Forum Updated to NodeBB v4.3 + New Features

Touchscreen not working with any Qt based application. But it works fine with GTK ones.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 222 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.
  • I Offline
    I Offline
    is0923
    wrote on last edited by
    #1

    I can't get touch to work with Qt widgets or QML based applications. The touchscreen (part of a multi-monitor setup) does work with GTK no problem. But any tap on a Qt based application gets completely ignored.

    I'm trying to develop a touch-based application on Fedora Linux using Qt Creator. Any idea what could be causing this problem?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Have you done this on your widget:

      setAttribute(Qt::WA_AcceptTouchEvents);
      
      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Also, please share a minimal example of what you try to do

        1 Reply Last reply
        0
        • I Offline
          I Offline
          is0923
          wrote on last edited by
          #4

          @Asperamanca I have set that flag in QML. But even if that was the only problem in my case, I don't understand why Qt based apps don't even register taps as clicks by default like GTK does.

          Here's the code for my simple app.

          import QtQuick
          import QtQuick.Window
          import QtQuick.Controls
          import QtQuick.Dialogs
          
          Window {
              width: 640
              height: 480
              visible: true
              title: qsTr("Hello World")
              flags: Qt.WA_AcceptTouchEvents
              Rectangle {
                  id: button
                  signal clicked
                  property alias text: buttonLabel.text
          
                  height: 50
                  width: 150
                  radius: 3
                  color: "gray"
          
                  TapHandler {
                      id: tapHandler
                      onTapped: console.log("clicked2")
                  }
          
                  MouseArea {
                      anchors.fill: parent
                      onClicked: console.log("clicked")
                  }
          
                  Text {
                      id: buttonLabel
                      text: "Click Me"
                      color: palette.buttonText
                      anchors.centerIn: parent
                  }
              }
          
          }
          
          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