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. HoverEnterEvent being called when it shoudn't
Qt 6.11 is out! See what's new in the release blog

HoverEnterEvent being called when it shoudn't

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.3k 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.
  • L Offline
    L Offline
    leonardoMB
    wrote on last edited by leonardoMB
    #1

    Here I have a situation Where I understand that HoverEnterEvent shoudn't be called.

    I have a button class with an tooltip attribute, this tooltip always show up through the HoverEnterEvent and it is hidden through HoverLeaveEvent. It works perfectly. But I also implemented a functionality for the button that just opens a QMessageBox.

    I realize that when I click the button, HoverLeaveEvent is called, I don't know why, but it's expected that behavior. But When I resolve the MessageBox the EnterHoverEvent of this button is called, what doesn't make sense for me. Since I'm not hovering it. What is happening?

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

      Hi,

      Where do you show your QMessageBox with respect to your button ?

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

      L 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Where do you show your QMessageBox with respect to your button ?

        L Offline
        L Offline
        leonardoMB
        wrote on last edited by
        #3

        @SGaist Basically I connected a signal that calls the slot responsible for creating the QMessageBox. The creation occurs inside this slot

        1 Reply Last reply
        0
        • L leonardoMB

          Here I have a situation Where I understand that HoverEnterEvent shoudn't be called.

          I have a button class with an tooltip attribute, this tooltip always show up through the HoverEnterEvent and it is hidden through HoverLeaveEvent. It works perfectly. But I also implemented a functionality for the button that just opens a QMessageBox.

          I realize that when I click the button, HoverLeaveEvent is called, I don't know why, but it's expected that behavior. But When I resolve the MessageBox the EnterHoverEvent of this button is called, what doesn't make sense for me. Since I'm not hovering it. What is happening?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @leonardoMB
          ...and/or additionally, possibly, where is your mouse with respect to the original button after you have dismissed the MessageBox?

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

            I meant "physically" on your UI.

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

              @SGaist @JonB
              My mouse is far away from the button When I dismiss the MessageBox.
              The MessageBox is not created upon the button, its away too.

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

                Can you provide a minimal compilable example ?
                Also which version of Qt ?
                On which OS ?

                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