PDA

View Full Version : QStandarItem clean data



guidupas
30th July 2014, 14:52
Hello!

I have a QStabdardItemModel and I need to clear the data of one cell but dont remove the row

I am trying this but its not working



modeloLancamentosAmortizacao->data(modeloLancamentosAmortizacao->index(0,2)).clear();


this way does not work either



QStandardItem *item = modeloLancamentosAmortizacao->item(0,2);
item->data().clear();


How can I do that?

Thanks

wysota
30th July 2014, 15:24
How about using QAbstractItemModel::setData()?