Results 1 to 8 of 8

Thread: No reaction after right clicking on the QTableWidget's headers

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    83
    Qt products
    Qt4
    Platforms
    Windows

    Default No reaction after right clicking on the QTableWidget's headers

    Hi!

    I have set the headers for my QTableWidget and want to perform some actions by right clicking on them, but I am failing. That means, I am not able to display the menu. Does anyone already have such problem? How to overcome it? However, any right click on a given cell of the corresponding column/row displays the menu.

    Many thanks in advance.

    Here is my code:

    Qt Code:
    1. void MyWindow::showContextMenu(const QPoint &pos)
    2. {
    3. QMenu *menu = new QMenu(this);
    4.  
    5. m_insererRow = menu->addAction("Inser row here");
    6.  
    7. QAction *selectedItem = menu->exec(QCursor::pos());
    8.  
    9. // Some actions...
    10. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Stanfillirenfro; 2nd April 2014 at 09:10.

Similar Threads

  1. QTableWidget do not hide headers on resize, what to do?
    By Bong.Da.City in forum Qt Programming
    Replies: 7
    Last Post: 24th June 2012, 16:39
  2. Resizing headers view in the QTableWidget
    By jano_alex_es in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2010, 10:55
  3. QTableWidget headers
    By vieraci in forum Qt Programming
    Replies: 2
    Last Post: 18th July 2009, 08:25
  4. Replies: 2
    Last Post: 11th March 2009, 02:00
  5. trying to union two headers of QTableWidget
    By uygar in forum Qt Programming
    Replies: 2
    Last Post: 25th September 2007, 15:55

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.