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. [Resolved] Touch Screen does not work for Qt5.3.2 app
Forum Updated to NodeBB v4.3 + New Features

[Resolved] Touch Screen does not work for Qt5.3.2 app

Scheduled Pinned Locked Moved Mobile and Embedded
14 Posts 2 Posters 7.9k 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.
  • S Offline
    S Offline
    stuartx
    wrote on last edited by
    #4

    Any one can help?

    Based on the debug printout, can I say that I missed the styles plugin? If so, how can I get the plugin? I turned on -gtk-style, I still don't have the style plugin and I can not find style src directory.

    Any help is appreciated.

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

      Is this what you got when calling your application with -plugin tslib ?

      By the way, your paths look a bit strange. How did you install Qt on your board ?

      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
      • S Offline
        S Offline
        stuartx
        wrote on last edited by
        #6

        Yes, I start the test program with "test -plugin tslib". I also set "TSLIB_TSDEVICE=/dev/input/event1".

        I installed Qt library in "/uisr/lib" and Qt plugins in "/usr/plugins". The QT_PLUGIN_PATH is set to "/usr/plugins".

        Thanks.

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

          That's a bit messy, you should install it in a dedicated subdir e.g. /usr/local/Qt5

          What do you get if you call ldd on the plugin ?

          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
          • S Offline
            S Offline
            stuartx
            wrote on last edited by
            #8

            Finally get the ldd utility work. Here is the output:

            ./ldd /usr/plugins/generic/libqtslibplugin.so

            @libts-0.0.so.0 => /usr/lib/libts-0.0.so.0 (0x4000e000)
            libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x40018000)
            libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x4052d000)
            librt.so.1 => /lib/librt.so.1 (0x40b15000)
            libdl.so.2 => /lib/libdl.so.2 (0x40b24000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40b2f000)
            libGL.so.1 => /usr/lib/libGL.so.1 (0x40b42000)
            libOSMesa.so.7 => /usr/lib/libOSMesa.so.7 (0x40de3000)
            libpthread.so.0 => /lib/libpthread.so.0 (0x40df6000)
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x40e16000)
            libm.so.6 => /lib/libm.so.6 (0x40eea000)
            libc.so.6 => /lib/libc.so.6 (0x40f95000)
            libpng.so.3 => /usr/lib/libpng.so.3 (0x410ba000)
            libz.so.1 => /usr/lib/libz.so.1 (0x410e4000)
            /lib/ld-linux.so.3 (0x2a000000)
            libX11.so.6 => /usr/lib/libX11.so.6 (0x410fe000)
            libXext.so.6 => /usr/lib/libXext.so.6 (0x411c6000)@

            ./ldd ./test-ts

               @libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x40026000)
                libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x40624000)
                libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x40b39000)
                librt.so.1 => /lib/librt.so.1 (0x41120000)
                libdl.so.2 => /lib/libdl.so.2 (0x4112f000)
                libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4113a000)
                libGL.so.1 => /usr/lib/libGL.so.1 (0x4114d000)
                libOSMesa.so.7 => /usr/lib/libOSMesa.so.7 (0x413ee000)
                libpthread.so.0 => /lib/libpthread.so.0 (0x41401000)
                libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x41420000)
                libm.so.6 => /lib/libm.so.6 (0x414f4000)
                libc.so.6 => /lib/libc.so.6 (0x4159f000)
                libpng.so.3 => /usr/lib/libpng.so.3 (0x416c4000)
                libz.so.1 => /usr/lib/libz.so.1 (0x416ee000)
                /lib/ld-linux.so.3 (0x40000000)
                libX11.so.6 => /usr/lib/libX11.so.6 (0x41707000)
                libXext.so.6 => /usr/lib/libXext.so.6 (0x417cf000)@
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #9

              Looks good, did you check the rights on the device ?

              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
              • S Offline
                S Offline
                stuartx
                wrote on last edited by
                #10

                ls -l /dev/input/*

                crwxr-xr-x 1 root root 13, 64 Jul 8 2014 /dev/input/event0
                lrwxrwxrwx 1 root root 17 Jun 7 15:28 /dev/input/event1 -> /dev/input/event0

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

                  Are you running your software as root ?

                  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
                  • S Offline
                    S Offline
                    stuartx
                    wrote on last edited by
                    #12

                    Yes, I run the test program "test-ts" as root.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      stuartx
                      wrote on last edited by stuartx
                      #13

                      We use the knobs example (located in Qt5.3.2-opensource/Examples/Qt-5.3/touch/knobs) as a test case to debug the touch screen problem. We found the following things:

                      Touchpad events from the tslib plugin are treated as mouse events, not touchpad events. Typically a touch action results in a Mouse Button press, possibly some Mouse Move events, and a Mouse Release event. (Qt events are defined in an enum in qtbase/src/corelib/kernel/coreevent.h)

                      I typically see event types 2, 3, 5 (MouseButtonPress, MouseButtonRelease and MouseMove) and 155, 156 and 157 (GraphicsSceneMouseMove, GraphicsSceneMousePress and GraphicsSceneMouseRelease). The Knobs event handler (knob.cpp: Knob::sceneEvent) is looking for event types 194, 195 and 196 (TouchBegin, TouchUpdate and TouchEnd)and will never respond to mouse events.

                      Knob is a class derived from QGraphicsItem. The knob is added into a QGraphicsScene object and this object provides event handling for the QGraphicsItem in its event() method.

                      I see the Type 155, 156 and 157 events in the event() method but only the 156 event shows up in the Knob::sceneEvent() function.

                      So in summary, I have three problems:

                      1. The tslib implementation is producing simulated mouse events for the touchpad but the Knob::sceneEvent() function is looking for Touchpad events.

                      2. Only one of the three events I see being generated are being reported to
                        Knob::sceneEvent().

                      3. In my original test case, there is no QGraphics / view involved. Why the MouseButtonPress event does not pass to the QPushButton objects?

                      We use linuxfb as QT_QPA_PLATFORM.

                      Any help is great appreciated.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        stuartx
                        wrote on last edited by stuartx
                        #14

                        It turns out that the Mesa library was not built properly. Fixed.

                        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