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. QGraphicsPathItem does not get hover events when mouse button is pressed

QGraphicsPathItem does not get hover events when mouse button is pressed

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

    My item only gets hover events when the mouse button is not pressed. This is also true if the item is selected. How can I get hover events all the time?

    Thanks

    1 Reply Last reply
    0
    • B Offline
      B Offline
      butterface
      wrote on last edited by
      #2

      I figured out that

      @
      option->state & QStyle::State_MouseOver
      @

      stays true if the mouse is pressed over an item and dragged. This happens even if I don't pass the mousePressEvent to the parent in this case. It seems that the scene is in some kind of move mode even though the item is not moveable.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Macro
        wrote on last edited by
        #3

        Please Edit your Question and prepend [Solved]....

        1 Reply Last reply
        0
        • B Offline
          B Offline
          butterface
          wrote on last edited by
          #4

          I will do that as soon as it is solved. What I added is just more information but as far away from a solution as it can be.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            butterface
            wrote on last edited by
            #5

            Sorry guys but it is completely unclear to me what happens while I drag the mouse. The only mouse-related events I get are mouseMove, mousePress and mouseRelease of the QGraphicsScene. There are no drag events, hover events or anything else. Not from the item where I start to drag, not from the view...nothing.

            I can drag items around if I set the correct flag but I don't want to drag this item. What I want to do is to change the colour of the item depending on some logic behind the scenes but without an event I would have to check the items under the mouse on every bit of movement and most of them are not colour changing ones so it would be a lot of overhead which is quite useless.

            I am happy to override every method in every class but I have to know where and I cannot find it.

            Any hints are more then welcome!

            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