Fixed bug that icons are not refreshed when deviceTypeId is updated

This commit is contained in:
2023-02-23 18:55:46 +01:00
parent 2128040cc1
commit dcabe003a4

View File

@@ -271,7 +271,7 @@ bool DevicesModel::setData(const QModelIndex &index, const QVariant &value, int
QMutexLocker locker{&m_controller->mutex()};
device.deviceTypeId = value.toInt();
}
emit dataChanged(index, index, { DeviceTypeIdRole });
emit dataChanged(index, index, { DeviceTypeIdRole, IconNameRole, IconUrlRole });
disconnect(m_controller, &DmxController::deviceDeviceTypeIdChanged,
this, &DevicesModel::otherDeviceDeviceTypeIdChanged);
@@ -513,7 +513,7 @@ void DevicesModel::otherDeviceDeviceTypeIdChanged(int row, int deviceTypeId)
}
const auto index = this->index(row);
emit dataChanged(index, index, { DeviceTypeIdRole });
emit dataChanged(index, index, { DeviceTypeIdRole, IconNameRole, IconUrlRole });
}
void DevicesModel::otherDeviceAddressChanged(int row, int address)