diff --git a/src/monitoreditemmodel.cpp b/src/monitoreditemmodel.cpp index aeb9798..f91d22a 100644 --- a/src/monitoreditemmodel.cpp +++ b/src/monitoreditemmodel.cpp @@ -105,11 +105,13 @@ void MonitoredItemModel::addEventItem(QOpcUaNode *node, const int pos = mItems.size() - 1; MonitoredItem *monitoredItem = new MonitoredItem(node, eventFilter); connect(monitoredItem, &MonitoredItem::displayNameChanged, this, [=]() { + const auto pos = mItems.indexOf(monitoredItem); emit dataChanged(index(pos), index(pos), QList() << DisplayNameRole); emit updated(); }); connect(monitoredItem, &MonitoredItem::lastEventsChanged, this, [=]() { + const auto pos = mItems.indexOf(monitoredItem); emit dataChanged(index(pos), index(pos), QList() << LastEventsRole); emit updated(); });