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. QStyledItemDelegate - mouse hover?

QStyledItemDelegate - mouse hover?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstyleditemdele
3 Posts 2 Posters 2.4k 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    Like topic says, how can I get mouse Hover event/mouse position to check if I want to change cursor/highlight stuff etc etc?

    TIA

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

      Hi
      First check what mouse events comes in
      https://doc.qt.io/qt-5/qabstractitemdelegate.html#editorEvent

      It says it gets mouse events but not which.

      D 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        First check what mouse events comes in
        https://doc.qt.io/qt-5/qabstractitemdelegate.html#editorEvent

        It says it gets mouse events but not which.

        D Offline
        D Offline
        Dariusz
        wrote on last edited by Dariusz
        #3

        @mrjj I'm not getting any move/hover events in that function.

        I don't edit anything yet to get it I think. I'm drawing 3 rects in paint() function and now I'd like to highlight each rect when mouse hover over it.

        EDIT. it looks like I had to view.setMouseTracking(True) to get the event in delegate o.O

        But it does not fire on mouse enter/leave action sigh. :D

        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