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. Cannot receive mouse event when using touch panel

Cannot receive mouse event when using touch panel

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 2 Posters 840 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.
  • K Offline
    K Offline
    kingkong
    wrote on last edited by
    #1

    OS: RPI 4 bullseye
    QT version: 5.15.2
    Touch panel: https://www.waveshare.com/wiki/5inch_DSI_LCD

    Hello everybody, I'm a noob of QT.
    I try to implement a function to let the image label be full screen by double click.

    1. The function can work when using mouse.
    2. Using touch panel, the lable first state is normal size, and do "normal size->full screen-> normal size" is ok.
      But after back to normal size, the application cannot receive the mouse event anymore.

    Code:
    https://github.com/mmarktsai/pyqt_photo_viewer

    Any help is very appreciate!

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

      Hi and welcome to devnet,

      You should avoid replacing objects method like that with a method from a different class. Use proper overloading to keep things clean. You should also avoid replacing self by something else. That is making your code confusing at best.

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

      K 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        You should avoid replacing objects method like that with a method from a different class. Use proper overloading to keep things clean. You should also avoid replacing self by something else. That is making your code confusing at best.

        K Offline
        K Offline
        kingkong
        wrote on last edited by
        #3

        @SGaist

        Thanks for your suggestion! I've modified it.

        Do you have any idea to fix the problem about missing mouse event with touch panel?

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

          Does it show other signs of misbehavior ?

          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
          • K Offline
            K Offline
            kingkong
            wrote on last edited by
            #5

            I use eventfilter to dump all events.
            There are touch events at first.
            After I let the image label be full screen and back to normal size, the touch event cannot get anymore.
            But the mouse events can still work.

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

              Does it affect only your application ?

              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
              • K Offline
                K Offline
                kingkong
                wrote on last edited by
                #7

                Yes, only the application cannot get any mouse event.
                The RPI desktop still can work.

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

                  What happens if you switch to another one and then come back to it ?

                  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
                  • K Offline
                    K Offline
                    kingkong
                    wrote on last edited by
                    #9

                    If I switch to another window and back to my window, my window still cannot work correctly.

                    https://drive.google.com/file/d/1H0MAkPo4HQB5sBBZ1_FhkshPtRSSD7Wf/view?usp=sharing

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

                      I would install a native event filter to see if there's something coming but not processed.

                      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