This function should remove a row from my QStandardItemModel attached to a QTable View.
void ModManager::delete_Addin(int index)
{
QString addinId;
int i;
addinId = tableModel->item(index,0)->text();
for(i=0;i<modList->size();i++)
{
if(modList->at(i)->Id() == addinId)
{
delete modList->takeAt(i);
break;
}
}
tableModel->removeRow(index);
}
The strange thing is that the program crashes at the last instruction, tableModel->removeRow(index);
And its not going out of range because tableModel->item(index,0)
is valid.
What could it be, then?