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?
QtWS25 Last Chance

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 25 Sept 2019, 19:20 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
  • M Offline
    M Offline
    mrjj Lifetime Qt Champion
    wrote on 25 Sept 2019, 19:26 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 26 Sept 2019, 02:20
    1
  • D Offline
    D Offline
    Dariusz
    replied to mrjj on 26 Sept 2019, 02:20 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

3/3

26 Sept 2019, 02:20

  • Login

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