Results 1 to 3 of 3

Thread: What signal for QTableView Row Column Push

  1. #1
    Join Date
    Nov 2011
    Posts
    30
    Qt products
    Qt3
    Platforms
    MacOS X

    Default What signal for QTableView Row Column Push

    I have a QTableView in my code that I am trying to detect when the user clicks on the RowHeaders. I have the individual cells working with the code below and they work great. But what signal do I connect for the Row/Column headers being pushed.

    Qt Code:
    1. QTableView *pkt_view;
    2.  
    3. ...
    4.  
    5. connect( pkt_view, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(packetClicked2(QModelIndex)) );
    6. connect( pkt_view, SIGNAL(clicked(QModelIndex)), this, SLOT(packetClicked(QModelIndex)) );
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: What signal for QTableView Row Column Push

    Get the view's vertical header view and connect to that object's sectionClicked() signal.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2011
    Posts
    30
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Re: What signal for QTableView Row Column Push

    Thanks. I was looking for clicked and not sectionClicked...

    Qt Code:
    1. connect( pkt_view, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(packetClicked(QModelIndex)) );
    2. connect( pkt_view, SIGNAL(clicked(QModelIndex)), this, SLOT(packetClicked2(QModelIndex)) );
    3. connect( pkt_view->verticalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(HeaderClicked(int)) );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 4
    Last Post: 27th February 2014, 10:42
  2. QTableView with a column of images
    By elanari in forum Qt Programming
    Replies: 13
    Last Post: 7th February 2012, 13:25
  3. Qtableview insert row and column
    By maarvi in forum Newbie
    Replies: 1
    Last Post: 1st July 2011, 10:26
  4. QTableView set column Decimals
    By ottoshmidt in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2010, 06:00
  5. Replies: 2
    Last Post: 18th October 2010, 18:58

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.