Remaining events apart from verification
This commit is contained in:
parent
718a58d388
commit
2360dfd80a
9 changed files with 286 additions and 88 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue