Remaining events apart from verification

This commit is contained in:
Nicolas Werner 2023-08-13 11:30:41 +02:00
parent 718a58d388
commit 2360dfd80a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
9 changed files with 286 additions and 88 deletions

View file

@ -195,17 +195,22 @@ EventDelegateChooser::DelegateIncubator::setInitialState(QObject *obj)
if (!forReply) {
auto row = chooser.room_->idToIndex(currentId);
connect(chooser.room_,
&QAbstractItemModel::dataChanged,
obj,
[row, update](const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QList<int> &changedRoles) {
if (row < topLeft.row() || row > bottomRight.row())
return;
auto connection = connect(
chooser.room_,
&QAbstractItemModel::dataChanged,
obj,
[row, update](const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QList<int> &changedRoles) {
if (row < topLeft.row() || row > bottomRight.row())
return;
update(changedRoles);
});
update(changedRoles);
},
Qt::QueuedConnection);
connect(&this->chooser, &EventDelegateChooser::destroyed, obj, [connection]() {
QObject::disconnect(connection);
});
}
}