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. HoverMouseEvent - Increase Time User Has to Hover over before active

HoverMouseEvent - Increase Time User Has to Hover over before active

Scheduled Pinned Locked Moved General and Desktop
eventhover
4 Posts 2 Posters 2.1k 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.
  • O Offline
    O Offline
    oracle3001
    wrote on 10 Jun 2015, 12:53 last edited by oracle3001 6 Oct 2015, 12:55
    #1

    What I would like to do is be able to set the time a user has to hover over an qGraphicsItem before say a popup window is shown.

    I am obviously well aware of hoverEnterEvent, hoverLeaveEvent and hoverMouseEvent, but what I would like to do (and can't work out) is be able to change the time a user has to hover over an item before I decide that was definitely the user trying to activate the popup.

    At the moment, it is far too easy for the user to accidentally swiftly move the mouse over the item and it show the popup, as QT is registering this as a hover event.

    I guess I could use some sort of timer and only if the hoverLeaveEvent hasn't been fired in that time, but that seems a very inefficient way of doing things.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maximus
      wrote on 10 Jun 2015, 13:09 last edited by maximus 6 Oct 2015, 13:17
      #2

      A QTimer which starts when the user enter your Widget would be a great easy solution.
      If the user leaves the widget, stop the timer.
      The timeout of the timer would trigger your popup. (User stayed for X seconds hovering your widget)

      Not inefficient, not sure what you mean?
      Good luck!


      Free Indoor Cycling Software - https://maximumtrainer.com

      1 Reply Last reply
      0
      • O Offline
        O Offline
        oracle3001
        wrote on 10 Jun 2015, 13:36 last edited by
        #3

        My concern with Timer is that I am likely to have a lot of QGraphicItems and the user will be moving the mouse rapidly over them on a constant basis. Thus, I am concerned I will end up with a large number of timers all starting / stopping / running at the same time, and this could cause performance issues.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maximus
          wrote on 10 Jun 2015, 16:00 last edited by maximus 6 Oct 2015, 16:01
          #4

          You could subclass QGraphicItems and implement the behavior only once there.

          Another thing to consider is using tooltip or asking the user to click on the QGraphicItem to trigger the pop-up instead of hovering. I haven't seem much software that open pop-up without the user asking for it, I would be annoyed by pop-up openning if it's not clear that my action opened it.


          Free Indoor Cycling Software - https://maximumtrainer.com

          1 Reply Last reply
          0

          2/4

          10 Jun 2015, 13:09

          • Login

          • Login or register to search.
          2 out of 4
          • First post
            2/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved