Having a row in the QTableWidget does not mean that all the columns on the row will have items on them. Items (QTableWidgetItem) have to be explicitly set on the cell(row, column)
for(int row = 0; row < ui->widget->rowCount(); row++)
{
qDebug() << "Ckeck point X " << row;
if(item_test != 0) //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
{
if(!item_test->text().isEmpty())
{
check_count++;
qDebug() << "Checkpoint y " << row;
}
}
else
{
qDebug() << "Checkpoint z: Item not set " << row; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
c++;
}
qDebug() << "Check Count" << check_count;
for(int row = 0; row < ui->widget->rowCount(); row++)
{
qDebug() << "Ckeck point X " << row;
QTableWidgetItem *item_test = ui->widget->item(row, 0);
if(item_test != 0) //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
{
if(!item_test->text().isEmpty())
{
check_count++;
qDebug() << "Checkpoint y " << row;
}
}
else
{
qDebug() << "Checkpoint z: Item not set " << row; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
c++;
}
qDebug() << "Check Count" << check_count;
To copy to clipboard, switch view to plain text mode
Bookmarks