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. Which code decides the target widget is for a touch point
Forum Updated to NodeBB v4.3 + New Features

Which code decides the target widget is for a touch point

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 846 Views 2 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.
  • M Offline
    M Offline
    mdb977
    wrote on last edited by mdb977
    #1

    I'm currently debugging a strange touch-event bug in an application that mixes widgets and QML GUI elements.

    In QGuiApplicationPrivate::processTouchEvent, the touch points delivered within the TouchEvent contain a target widget.

    So somewhere between the QPA event handler implemented in qwindowsysteminterface.cpp and QGuiApplicationPrivate::processTouchEvent, the system decides the target widget for a touch point.

    Can you please point me to the corresponding Qt code for this assignment?

    I want to understand this better.

    Thanks

    Axel SpoerlA 1 Reply Last reply
    0
    • M mdb977

      I'm currently debugging a strange touch-event bug in an application that mixes widgets and QML GUI elements.

      In QGuiApplicationPrivate::processTouchEvent, the touch points delivered within the TouchEvent contain a target widget.

      So somewhere between the QPA event handler implemented in qwindowsysteminterface.cpp and QGuiApplicationPrivate::processTouchEvent, the system decides the target widget for a touch point.

      Can you please point me to the corresponding Qt code for this assignment?

      I want to understand this better.

      Thanks

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @mdb977
      It would be good to understand more about the bug you are investigating.
      processTouchEvent is probably a good start. The touch event already knows, to which QWindow the event has been delivered. That is not up to Qt to determine. The decision is made on the underlying window system, e.g. X11 or Windows. QGuiApplication doesn't know about widgets or quick windows. It delivers events on a QWindow level.

      So what goes wrong in your application?

      Software Engineer
      The Qt Company, Oslo

      M 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        @mdb977
        It would be good to understand more about the bug you are investigating.
        processTouchEvent is probably a good start. The touch event already knows, to which QWindow the event has been delivered. That is not up to Qt to determine. The decision is made on the underlying window system, e.g. X11 or Windows. QGuiApplication doesn't know about widgets or quick windows. It delivers events on a QWindow level.

        So what goes wrong in your application?

        M Offline
        M Offline
        mdb977
        wrote on last edited by
        #3

        @Axel-Spoerl

        Thanks for your message.

        You are talking about the target of the touch event.
        I'm, however, talking about the target of the touchpoints.

        This target is sometimes corrected for touch-press in translateRawTouchEvent in qapplication.cpp.

        https://codebrowser.dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp.html#3856

        I want to know who is setting the target for the touchpoints.

        Regarding my problem: In a particular case, I have a pair of touch events (press and corresponding release). The press event is synthesized into a mouse click as it should in processTouchEvent. However, the release is delivered to my quick widget, which accepts the release (so the release is not synthesized).

        I have a hacky patch solving my problem, but I want to understand it better.

        I also have a small standalone Qt example showing the problem, but I wonder if I should open a ticket in bugreports.qt.io for a bug I do not fully understand.

        Axel SpoerlA 1 Reply Last reply
        0
        • M mdb977

          @Axel-Spoerl

          Thanks for your message.

          You are talking about the target of the touch event.
          I'm, however, talking about the target of the touchpoints.

          This target is sometimes corrected for touch-press in translateRawTouchEvent in qapplication.cpp.

          https://codebrowser.dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp.html#3856

          I want to know who is setting the target for the touchpoints.

          Regarding my problem: In a particular case, I have a pair of touch events (press and corresponding release). The press event is synthesized into a mouse click as it should in processTouchEvent. However, the release is delivered to my quick widget, which accepts the release (so the release is not synthesized).

          I have a hacky patch solving my problem, but I want to understand it better.

          I also have a small standalone Qt example showing the problem, but I wonder if I should open a ticket in bugreports.qt.io for a bug I do not fully understand.

          Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by Axel Spoerl
          #4

          @mdb977 said in Which code decides the target widget is for a touch point:

          Could it be, that your problem is related to this?
          I am asking, because a colleague of mine implemented a great fix recently, where we swallowed touch events. In parallel, I'll look into our code for setting the target of touch points.

          Software Engineer
          The Qt Company, Oslo

          M 1 Reply Last reply
          0
          • Axel SpoerlA Axel Spoerl

            @mdb977 said in Which code decides the target widget is for a touch point:

            Could it be, that your problem is related to this?
            I am asking, because a colleague of mine implemented a great fix recently, where we swallowed touch events. In parallel, I'll look into our code for setting the target of touch points.

            M Offline
            M Offline
            mdb977
            wrote on last edited by
            #5

            @Axel-Spoerl

            Thanks for the link.
            At a glance, it is unrelated.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mdb977
              wrote on last edited by
              #6

              @Axel-Spoerl

              I'm still interested in the code for setting the target of touchpoints.
              Meanwhile, I managed to reproduce the issue with a handful of lines of code on a desktop Qt application using Qt 6.6.1. So, I think this is a Qt Bug.

              Regards

              Axel SpoerlA 1 Reply Last reply
              0
              • M mdb977

                @Axel-Spoerl

                I'm still interested in the code for setting the target of touchpoints.
                Meanwhile, I managed to reproduce the issue with a handful of lines of code on a desktop Qt application using Qt 6.6.1. So, I think this is a Qt Bug.

                Regards

                Axel SpoerlA Offline
                Axel SpoerlA Offline
                Axel Spoerl
                Moderators
                wrote on last edited by
                #7

                @mdb977
                File a bug report, I am getting curious.

                Software Engineer
                The Qt Company, Oslo

                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