Results 1 to 1 of 1

Thread: QTableWidget with checkboxes.

  1. #1
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: QTableWidget with checkboxes.

    Hi guys,

    I have a QTableWidget with checkboxes in the 1st column. I have a button to 'select all' which is implemented,

    Qt Code:
    1. for(int i = 0; i < tableWidget->rowCount(); i++) {
    2. QTableWidgetItem *twi = tableWidget->item(i, 0);
    3. twi->setCheckState(Qt::Checked);
    4. }
    To copy to clipboard, switch view to plain text mode 

    I'm finding that the 1st checkbox in my table doesnt get properly updated. (Subsequently checking on another row cause it to be displayed properly). I tried calling
    Qt Code:
    1. tableWidget->repaint
    To copy to clipboard, switch view to plain text mode 
    afterwards but this doesnt fix my problem.

    I'm sure I'm doing something dumb, (1/2 asleep due to new baby), any help appreciated.

    Cheers,
    Chris.


    Added after 22 minutes:


    Answering my own questions.
    Theres a bug in Qt http://bugreports.qt.nokia.com/browse/QTBUG-5042

    To resolve I call
    Qt Code:
    1. tableWidget->verticalHeader()->show();
    2. tableWidget->verticalHeader()->hide();
    To copy to clipboard, switch view to plain text mode 
    Last edited by chris_helloworld; 13th January 2011 at 16:39.

Similar Threads

  1. Replies: 8
    Last Post: 23rd October 2009, 16:33
  2. qtreeview + checkboxes
    By lamera in forum Newbie
    Replies: 9
    Last Post: 6th September 2008, 23:10
  3. checkboxes
    By abrou in forum Newbie
    Replies: 2
    Last Post: 1st February 2008, 19:52
  4. Checkboxes in QAbstractITemModel
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 28th November 2007, 21:23
  5. QTreeView with checkboxes
    By shad in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2006, 14:29

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.