Results 1 to 20 of 27

Thread: How do I obtain mouse hover/popup functionality in a Qtableview?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Oct 2008
    Location
    Europe
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How do I obtain mouse hover/popup functionality in a Qtableview?

    Qt Code:
    1. view->setMouseTracking(true);
    2. view->viewport()->setAttribute(Qt::WA_Hover,true);
    3.  
    4.  
    5.  
    6. bool BoxDelegate::editorEvent ( QEvent * event, QAbstractItemModel * model, const QStyleOptionViewItem & option, const QModelIndex & index )
    7. {
    8.  
    9. qDebug()<<index.row();
    10. if ( event->type() == QEvent::HoverEnter ) { qDebug()<<"enter..."; } // doesnt appear. (it does on mousemove)
    11.  
    12. return 0;
    13. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 19th March 2009 at 09:15. Reason: missing [code] tags

Tags for this Thread

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.