Results 1 to 2 of 2

Thread: How to select a QTableWidget cell containing a QCheckBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Eastern U.S.
    Posts
    9
    Thanks
    1
    Qt products
    Qt4 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default How to select a QTableWidget cell containing a QCheckBox

    I have a QTableWidget in which I have set some cells to contain QCheckBox'es. When the dialog is running, if I click in a cell containing a checkbox, it will be selected, and turn blue. How can I make this happen programmatically? I tried using setCurrentCell() but that seems to invoke a different kind of selection, where the item only turns grey, which is indistinguishable on rows that are already grey (I'm using the "alternating row colors" setting).

    Any help would be greatly appreciated!

    Jeff

  2. #2
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to select a QTableWidget cell containing a QCheckBox

    Take a look at QItemSelectionModel. You can get pointer to it from the QTableWidget with the method selectionModel(). Good luck.

Similar Threads

  1. Replies: 1
    Last Post: 23rd March 2009, 21:36
  2. Replies: 0
    Last Post: 2nd May 2008, 07:57
  3. QTableWidget row select
    By nowire75 in forum Newbie
    Replies: 4
    Last Post: 23rd December 2007, 18:59
  4. Select columns from a QTableWidget
    By toglez in forum Qt Programming
    Replies: 10
    Last Post: 7th October 2007, 15:15
  5. Word wrapping in a QTableWidget cell
    By jcooperddtd in forum Qt Programming
    Replies: 3
    Last Post: 1st May 2007, 03:57

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.