Results 1 to 2 of 2

Thread: Wizard and QTableWidget

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Wizard and QTableWidget

    Hi all,

    I'm working on a wizard project. In one of its pages I put a QtableWidget.
    Qt Code:
    1. tableWidget = new QTableWidget(3, 4, this);
    2. for (int row_j=0; row_j < 3; ++row_j)
    3. {
    4. for (int column_i=0; column_i < 4; column_i++)
    5. {
    6. item->setTextAlignment (Qt::AlignCenter);
    7. tableWidget->setItem(row_j, column_i, item);
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    then for the first column I have a check box as follow:
    Qt Code:
    1. tableWidget->item(0, 0)->setCheckState ( Qt::Checked );
    2. tableWidget->item(1, 0)->setCheckState ( Qt::Checked );
    3. tableWidget->item(2, 0)->setCheckState ( Qt::Checked );
    To copy to clipboard, switch view to plain text mode 

    My question is, how can I retrieve both the state of each chech box (in the first column) and the values of the other item of the table using the funtions

    void registerField ( ... ) and
    QVariant field ( ... ) const

    ??

    The QTAssistent shows this only for QLineEdit ..

    Thank you very much for your help and kind reply..

    Roberto.
    Last edited by rmagro; 18th September 2008 at 15:26.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Wizard and QTableWidget

    I'm afraid it is not possible using registerField() because first of all QTableWidget does not provide a signal for check state changes, and even if it did, they would carry the changed item as parameter ie. there wouldn't be individual signals for each item.
    J-P Nurmi

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.