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. QGraphicsItems, QGraphicsProxyWidgets and HoverEvents
Qt 6.11 is out! See what's new in the release blog

QGraphicsItems, QGraphicsProxyWidgets and HoverEvents

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • P Offline
    P Offline
    Pippin
    wrote on last edited by
    #1

    Hello,

    I have coded my application so that, if I hover on my QGraphicsItems long enough (200 ms), QGraphicsProxyWidgets (which are QToolButtons) appear on them. I've also coded my application so that, if I stop hovering on my QGraphicsItems, all QGraphicsProxyWidgets/QToolButtons instantly disappear.

    And this is a problem because, if I decide to click on one of those QGraphicsProxyWidgets/QToolButtons, I stop hovering on the QGraphicsItem beneath it first, and all QGraphicsProxyWidgets/QToolButtons disappear right away as a result.

    Is there a way to fix that? I would like to make my QGraphicsProxyWidgets/QToolButtons transparent hovering-wise, I mean: they are visible, but if I hover on them, they are not considered to be hovered on and instead, the first QGraphicsItem under them is. That would solve my problem but I don't know if that's possible.

    Any help would be greatly appreciated. Thanks.

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

      Hi,

      You can try with an event filter. See QObject::installEventFilter for more information

      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
      1
      • P Offline
        P Offline
        Pippin
        wrote on last edited by Pippin
        #3

        Hello @SGaist , I'm sorry but I'm not sure I understand what I should try. How can filters solve this problem?

        Edit: I've managed it by subclassing QGraphicsScene. Thanks.

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

          You're welcome !

          Since you have a working now, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

          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