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. Enabling touch screen in Qt4(4.8.5)/X11
Forum Updated to NodeBB v4.3 + New Features

Enabling touch screen in Qt4(4.8.5)/X11

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 2.6k 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.
  • T Offline
    T Offline
    thombarepr
    wrote on last edited by
    #1

    Hello guys,
    I am beginner with Qt so need help with enabling touchscreen.
    I am using Qt4/X11 on imx6d. I have driver (kernel module) for touchscreen and it is working fine with tslib.
    What I dont know is

    1. How touch data is passed from linux input subsystem to qt. Is there any plugin for this?
      I have seen mouseplugins (linuxinput, linuxtp, tslib) but those seems to be tied with qt embedded and even after enabling during configuring qt, these plugins are not compiled at all.
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Indeed the tslib plugin is used only for Qt Embedded.

      Since you are using X11, it's the Xorg server responsibility to handle these events and pass them to Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thombarepr
        wrote on last edited by
        #3

        Thanks you for reply.

        I noticed that if i connect mouse to board Qt demo app works fine, mouse event are received by app. But touch events are not detected.

        I suspect problem is with event types handled in Qt. I am using multi touch capable device. So driver is sending MT events. Even to make tslib work i had to apply patch for MT support.

        I guess Qt 4.8.5 don't support MT, not sure about this. Please correct if I am wrong.

        If above is true is there any patch to enable MT events in Qt 4.8.5.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're wrong, Qt 4 support touch events.

          Did you set the Qt::WA_AcceptTouchEvents attribute on your widgets ? Otherwise, the event will be sent has mouse events.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • T Offline
            T Offline
            thombarepr
            wrote on last edited by
            #5

            Is there any difference in simple touch events and multi touch events from Qt perspective. Or it is supposed to be X, who handle this and pass appropriate events to Qt?

            I tested using Qt demo app pathstroke and setAttribute(Qt::WA_AcceptTouchEvents); is there in app.
            Now I am going to dig a little to put logs in ProcessEvents in qeventdispatcher_x11.cpp. I hope this is place where all X events are handled.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              AFAIK, X should pass the events to Qt where you can then handle them.

              If you want to handle X11 events in your application you have the x11EventFilter and x11ProcessEvent methods that you can reimplement.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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