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. #21
    Join Date
    Oct 2008
    Location
    Europe
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

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

    in my_model::data I added a:
    Qt Code:
    1. if(role== Qt::EditRole ) {
    2. return QString(index.data(0).toString());
    3. }
    To copy to clipboard, switch view to plain text mode 
    since I read on http://wiki.qtcentre.org/index.php?t...tractItemModel
    that Qt::EditRole returns a string, and now upon doubleclick the values "stay" in the cell.
    But the story isnt over, I still dont understand how to use QSqlTableModel 's delegates on my_model too
    (i have a datetime type in mysql which automagically has a spinbox editor in QSqlTableModel )

    Someone should further edit the wiki article with examples of the functions
    Attached Images Attached Images
    Last edited by wysota; 6th May 2009 at 08:35. 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.