red color only for name column

This commit is contained in:
iLLiCiTiT 2021-04-30 10:24:01 +02:00
parent 21620f715f
commit f79d497313

View file

@ -631,10 +631,6 @@ class BaseItem:
if role == DUPLICATED_ROLE:
return self._is_duplicated
if role == QtCore.Qt.ForegroundRole:
if self._is_duplicated:
return QtGui.QColor(255, 0, 0)
if role == QtCore.Qt.ToolTipRole:
if self._is_duplicated:
return "Asset with name \"{}\" already exists.".format(
@ -644,6 +640,11 @@ class BaseItem:
if key not in self.columns:
return None
if role == QtCore.Qt.ForegroundRole:
if self._is_duplicated and key == "name":
return QtGui.QColor(255, 0, 0)
return None
if role in (QtCore.Qt.DisplayRole, QtCore.Qt.EditRole):
value = self._data[key]
if value is None: