Results 1 to 2 of 2

Thread: QListWidgetItem Mouse Enter/Leave Event

  1. #1
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default QListWidgetItem Mouse Enter/Leave Event

    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

  2. #2
    Join Date
    Dec 2016
    Location
    New England, US
    Posts
    31
    Thanks
    6
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidgetItem Mouse Enter/Leave Event

    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.

Similar Threads

  1. Qt widget enter/leave event
    By bunjee in forum Qt Programming
    Replies: 11
    Last Post: 28th April 2014, 04:09
  2. Replies: 2
    Last Post: 11th August 2011, 11:55
  3. QGraphicsItem can't receive mouse leave/enter event
    By wshn13 in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2011, 09:32
  4. Mouse Leave and Tab Key event in Delegate
    By faldzip in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2008, 20:04
  5. Tooltip enter/leave event.
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2007, 12:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.