No, AFAIK there is no such signal, but you can crack it.
When editing an item from QTableView
an activated
signal is generated. The idea is to catch this signal and connect it to the slot in which the last manually changed item will be saved.
connect(view, SIGNAL(activated(QModelIndex), this, SLOT(manuallyActivated(QModelIndex))); void manuallyActivated(QModelIndex index) {
Now just change your dataChanged
slot to check if the item that was changed matches the last changed item.
void dataChanged(QStandardItem* item) { // If it is invalid simply ignore it... if (lastManuallyModifiedIndex.isValid() == false) return; // only if it is modified manually we process it if (item->index() == lastManuallyModifiedIndex) { // make last modified index invalid lastManuallyModifiedIndex = QModelIndex(); doSomething(); } }
pnezis source share