Results 1 to 3 of 3

Thread: QTableView row selection

  1. #1
    Join Date
    Dec 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableView row selection

    I've got a QTableView displaying a table of 3 columns and any number of rows. When the user clicks on a row or an item in the row it selects (via a connect) an item in a graphics scene. However I would also like to able to highlight a row when the user clicks on an item in the scene. I can't see anyway of highlighting a row in code, only via a mouse click.

    Is it also possible to prevent columns and the whole table from being highlighted when a user clicks of those parts of the table?

  2. #2
    Join Date
    Jan 2006
    Location
    Netherlands
    Posts
    56
    Thanks
    10
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: QTableView row selection

    i'm not a Qt4 user, but Qt3.... but if i check the Qt4 Assistent. i see this function:

    Qt Code:
    1. void QTableView::selectRow ( int row ) [slot]
    To copy to clipboard, switch view to plain text mode 
    Selects the given row in the table view if the current SelectionMode and SelectionBehavior allows rows to be selected.
    See also selectColumn().

    Maybe this is what you are searching?
    Last edited by BrainB0ne; 5th December 2007 at 14:21. Reason: spelling error
    ..:: Still Standing Strong ::..

  3. #3
    Join Date
    Dec 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView row selection

    I tried that one as it was the obvious one I found, but unfortunately it doesn't highlight the row.

Similar Threads

  1. [SOLVED] QTreeView drawing selection with icons
    By Timewarp in forum Qt Programming
    Replies: 7
    Last Post: 7th February 2013, 07:52
  2. QTableView selection problem
    By aiprober in forum Qt Programming
    Replies: 12
    Last Post: 9th June 2008, 11:55
  3. Model sorting vs. selection
    By VlJE in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2006, 16:46
  4. CheckBox and selection in QTableView
    By Mike Krus in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2006, 20:31
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.