'qt - qstandarditemmodel::itemchanged gives an invalid qvariant with a valid index
I have the following connection in my TypeABC
connect(model, &QStandardItemModel::itemChanged, this, &TypeABC::update);
void TypeABC::update(QStandardItem *item) {
auto data = item->data();
auto idx = item->index();
}
after editing when I display data and index from item in TypeABC::updateOffers I get :
QVariant(Invalid) QModelIndex(1,1,0x557a76315220,QStandardItemModel(0x557a763d89e0))
on console...
Why I am getting an invalid qvariant here yet the index is alright? I am feeding the model by using QStandardItemModel::setData like :
model->setData(model->index(rowNumber, Columns::Name), name); //name is a QString
and the tableview seems good too
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
