Qt QTreeView mouse entered/left event?

730 views Asked by At

There is a "entered" signal for a QTreeView Widget, which I can use to check if my mouse moves over an item.

Is there a way to implement an "left" signal?

Why: I have a treeView with a lot of items which I also plot via QChart. I want to highlight the plot when someone mouse over the data in the treeview. I can highlight it via the "entered" signal, but I have no idea how to change it back to the default if the mouse left/mouse is over another item...

1

There are 1 answers

0
Mariusz Jaskółka On

entered is a member of QAbstractItemView. You should probably reimplement QAbstractItemView::dragLeaveEvent virtual method.

See this method documentation: http://doc.qt.io/qt-5/qabstractitemview.html#dragLeaveEvent