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. Mouse not working in custom widget
QtWS25 Last Chance

Mouse not working in custom widget

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.6k Views
  • 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.
  • H Offline
    H Offline
    hmartinez
    wrote on last edited by
    #1

    Hello,

    I am facing a problem where the mouse clicks are not working.

    I have a custom widget (let's call it widget A) which contains several objects such as buttons, sliders, line edit, etc. This widget A also contains a promoted widget which is a custom opengl widget (widget B) I have created.

    When the widget A is shown, the window is displayed and also the widget B is properly working. However, the mouse clicks on the buttons and other elements in widget A are not working. Moreover, the keyboard events are properly working and I can use the TAB key to switch between buttons, line edit, etc and I can even write text in the line edit. So it seems that widget works OK, but something is blocking the mouse for some reason (like a transparent layer or something). I am wondering if widget B has something to do with it.

    And here is one more thing. The mouse click on the X to close the widget A works. For that event, I have one window asking user if he/she wants to close the window. If I click "no", it gets back to the widget A and then the mouse works perfectly.

    Can someone guess why is not working when showing widget A the first time, but working after trying to close the window?

    Thank you in advance.

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

      I could't reproduce that with the latest Qt 5.4 code from git (compiled with MinGW and OpenGL desktop option)

      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
      • H Offline
        H Offline
        hmartinez
        wrote on last edited by
        #3

        I tested the example myself and it was giving the same error. When the window containing the opengl is open, are you able to click with the mouse both line edit widgets?

        I am using Qt 5.3.1, could it be a bug solved in qt 5.4 then?
        Do you have any chance to test it in an earlier version?

        If this was the reason, then I would try to update to 5.4, but it would take some time to update the projects and libraries that depend on Qt.

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

          Yes, I could edit both QLineEdits

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

            I have just tried with latest version I found:
            qt-opensource-windows-x86-msvc2010_opengl-5.4.0-beta

            And still the same problem. I can edit the QLineEdits with keyboard, but can't select them with the mouse.

            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