Hello, I just can’t make the slot work in any QTableView cell, try a lot of any slots and signals, only the clicked () signal works when you click on this cell. But it does not suit me ... Here I’ve stopped at this:

... connect(ui->tableView->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex, QVector<int>)), this, SLOT(changeData(QModelIndex, QModelIndex, QVector<int>))); ... void StaffsForm::changeData(QModelIndex row, QModelIndex col , QVector<int> vec) { qDebug() << "Заработало!"; } 
  • Did the flags () in the model override? - Grin L.
  • No, is it possible in more detail? - QuickDzen
  • What kind of model? Is the data in it exactly changed? dataChanged she send a dataChanged signal? - yrHeTaTeJlb
  • If the model is written by you, then show the implementation of the flags and setData methods - yrHeTaTeJlb
  • No, not by me, I used QStandartItemModel and added Items to it - QuickDzen

1 answer 1

It works for me:

 ... connect(model, &QStandardItemModel::itemChanged, this, &ClientData::itemChange); ... void ClientData::itemChange(QStandardItem *item) { somecode(item->text()); } 
  • Doesn't work like that - QuickDzen