Hi all,
I have a QtableWidget defines as follows:
for (int row_j=0; row_j < 3; ++row_j)
{
for (int column_i=0; column_i < 4; column_i++)
{
item->setTextAlignment (Qt::AlignCenter);
tableWidget->setItem(row_j, column_i, item);
}
}
tableWidget->item(0, 0)->setCheckState ( Qt::Checked ); <------
tableWidget->item(1, 0)->setCheckState ( Qt::Checked ); <------
tableWidget->item(2, 0)->setCheckState ( Qt::Checked ); <------
TableLayout->addWidget (tableWidget);
layout->addWidget(frameQTable);
setLayout(layout);
tableWidget = new QTableWidget(3, 4, this);
for (int row_j=0; row_j < 3; ++row_j)
{
for (int column_i=0; column_i < 4; column_i++)
{
QTableWidgetItem *item = new QTableWidgetItem;
item->setTextAlignment (Qt::AlignCenter);
tableWidget->setItem(row_j, column_i, item);
}
}
tableWidget->item(0, 0)->setCheckState ( Qt::Checked ); <------
tableWidget->item(1, 0)->setCheckState ( Qt::Checked ); <------
tableWidget->item(2, 0)->setCheckState ( Qt::Checked ); <------
QGroupBox *frameQTable = new QGroupBox(tr(""));
QVBoxLayout *TableLayout = new QVBoxLayout(frameQTable);
TableLayout->addWidget (tableWidget);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(frameQTable);
setLayout(layout);
To copy to clipboard, switch view to plain text mode
Using the code as the shows by the arrows above, I put into the first cell of each row a CheckBox..
The Question is :
is there a way to emit a signal when the I click on the CheckBox?
So far the only signal is working for me is itemSelectionChanged ():
connect(tableWidget, SIGNAL(itemSelectionChanged () ),
this, SIGNAL(completeChanged()));
connect(tableWidget, SIGNAL(itemSelectionChanged () ),
this, SIGNAL(completeChanged()));
To copy to clipboard, switch view to plain text mode
that works indeed when I move to another item....
but not when I put the check..
Thank you for your kind reply..
Roberto
Bookmarks