PDA

View Full Version : QListWidgetItem Mouse Enter/Leave Event



tvj4218
5th January 2017, 14:47
Hello. I am attempting to change the mouse cursor to pointing hand cursor for a QListWidget when the mouse hovers over any of the list items.
I've added a slot and connected it to QListWidget::itemEntered signal. I get a signal and change the mouse cursor to pointing hand cursor, and this works fine. The problem is I don't know when to set the cursor back to the default mouse cursor as there is no leaveEvent for QListWidgetItem.
Not all of the list widget is populated so it has blank area on the bottom half, and when I move the mouse to the bottom part after the cursor is changed to pointing hand cursor, it stays that way, which also something I don't want.

Thank you in advance for your help.

tvj

NameRakes
5th January 2017, 20:14
There is the QAbstractItemView::viewportEntered() signal. I am guessing if you respond to that signal and revert to the default cursor, it might work. If it does, please post back. Thanks.