Results 1 to 4 of 4

Thread: QAbstractItemView::entered signal, where is QAbstractItemView::left signal ?

  1. #1
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QAbstractItemView::entered signal, where is QAbstractItemView::left signal ?

    Hello guys,

    I need to do custom processing for and item every time when mouse enters the visible region of an item. Also I need to do some processing when the item is left by the mouse. I found QAbstractItemView::entered signal, which looks exactly what I want. However I could not find corresponding QAbstractItemView::left signal.

    I've done some searching and found people suggested to remember current item and do the "leave event" processing for current item each time when the mouse enters visible region of the other item. This unfortunately does not work for me, because if mouse leaves an item it does not always mean that it enters the other item. It is possible for me that there is no current item at all.

    How can I do this ? Please help.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QAbstractItemView::entered signal, where is QAbstractItemView::left signal ?

    Set an event filter on the widget and look for QEvent::Leave event? You could even subclass the view and implement that in the class so it can fire a Leave or Left signal.

  3. #3
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QAbstractItemView::entered signal, where is QAbstractItemView::left signal ?

    Quote Originally Posted by fatjuicymole View Post
    Set an event filter on the widget and look for QEvent::Leave event? You could even subclass the view and implement that in the class so it can fire a Leave or Left signal.
    Thats true, but in this case I will have to implement the logic which actually maps event->point() into the QModelIndex. I guess its not very hard task, but anyways. If they have put QAbstractItemView::entered(QModelIndex) event what were their points not to put corresponding leave event ? I'm sure there were some points, probably its possible to emulate the signal by using all other QAbstractItemView signals ?

  4. #4
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QAbstractItemView::entered signal, where is QAbstractItemView::left signal ?

    It looks that when you leave an item QAbstractItemView::viewportEntered signal is emitted. So thanks all, the problem is resolved (they could put some comments about this in documentation though, its not so obvious)

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  3. Possible signal mapper problem
    By MarkoSan in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2008, 13:11
  4. Replies: 2
    Last Post: 17th May 2006, 21:01

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.