[SOLVED] QTableWidget can not add item correctly
HI
I getting data from data base and save it in QList<Storage> listStorage, where
Code:
struct Storage{
double Price;
double TaxValue;
int IdItem;
etc...
}
This is how I'm feeding list of storage
Code:
for(int i = 0; i < records.count(); i++)
{
Storage st;
st.Name = records[i].value("Name").toString();
st.Price = records[i].value("Price").toDouble();
st.TaxValue = records[i].value("TaxValue").toDouble();
listStorage.append(st);
}
At the end, when all sql queries are executed, I'm trying to feed my QTableWidget:
Code:
ui->tblStorage->setRowCount(records.count());
for(int i = 0; i < records.count(); i++){
...
}
All columns are being inserted correctly, bu on one "Price" I'm getting error:
What is wrong?
PS: I found the issue. I have method that is being executed when one of cell in table change value.
This method is recalculating items and makes this error.