Results 1 to 2 of 2

Thread: QTableView contextMenuEvent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Posts
    38
    Thanks
    5
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QTableView contextMenuEvent

    Never mind, I think I've found the answer!

    Qt Code:
    1. void MainWindow::contextMenuEvent(QContectMenuEvent *event)
    2. {
    3. ...
    4. QString type = model->data(fileTableView->currentIndex(), Qt:: DecorationRole).typeName();
    5. if (type == "QIcon")
    6. menu.addAction(expandInfoAct);
    7.  
    8. ...
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    Thanks anyway
    Last edited by derrickbj; 1st March 2007 at 16:39. Reason: Correction

Similar Threads

  1. Set height of QTableView to fit exact number of rows.
    By Ben.Hines in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2019, 01:49
  2. QTableView sorting
    By gabriels in forum Qt Programming
    Replies: 11
    Last Post: 6th October 2010, 17:13
  3. QTableView currentChanged <> selecting header
    By Everall in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2009, 08:24
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Multi-line messages in QTableView
    By Conel in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 13:49

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
  •  
Qt is a trademark of The Qt Company.