Results 1 to 2 of 2

Thread: Deselecting Rows in a QTableWidget

  1. #1
    Join Date
    May 2011
    Posts
    14
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Deselecting Rows in a QTableWidget

    Good Day Everyone,

    I am current working with a QTableWidget and have questions regarding selection methods. I have the table set so the selectionMode is SingleSelection and the SelectionBehavior is row. When I left click on an item it selects the entire row as expected. When I click on another item in a different row it deselects the current row and selects the new row. My issue now, is how do I go about deslecting the row?

    I was trying to find a method that would all me to do something like

    if ( RowSelected )
    {
    UnselectRow ( row_num )
    }

    But am unsure what I really should be looking for.

    Any guidance would be appreciated.

    Thank you

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deselecting Rows in a QTableWidget

    QAbstractItemView::clearSelection() or the equivalent method on the selection model itself: QItemSelectionModel::clearSelection()

Similar Threads

  1. QTableWidget set value of many rows in One Step
    By sagirahmed in forum Newbie
    Replies: 3
    Last Post: 11th October 2010, 06:08
  2. Deselecting selection on QTableWidget
    By grantbj74 in forum Newbie
    Replies: 3
    Last Post: 27th May 2010, 04:28
  3. How to set rows of QtableWidget to the same height?
    By sawerset in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2008, 18:09
  4. QTableWidget - Select multiple rows.
    By wally in forum Qt Programming
    Replies: 2
    Last Post: 21st October 2008, 17:15
  5. QTableWidget's rows deletion and again insertion
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2006, 18:30

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.