forked from qt-creator/qt-creator
Deduplicate calls for obtaining model index
Change-Id: I799742a06ce592ab935ee0609d5930a7d26a44e1 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
9264cebe24
commit
586c6dd92f
@@ -70,8 +70,10 @@ void SerialDeviceModel::disablePort(const QString &portName)
|
||||
return info.portName() == portName;
|
||||
});
|
||||
|
||||
if (i >= 0)
|
||||
emit dataChanged(index(i), index(i), {Qt::DisplayRole});
|
||||
if (i >= 0) {
|
||||
const QModelIndex itemIndex = index(i);
|
||||
emit dataChanged(itemIndex, itemIndex, {Qt::DisplayRole});
|
||||
}
|
||||
}
|
||||
|
||||
void SerialDeviceModel::enablePort(const QString &portName)
|
||||
|
||||
Reference in New Issue
Block a user