- Enable/Disable Object toggle key ("Space" key) will trigger also the datChanged signal for the Project MVC

- added a new setting for the color of the Porject items, the color when they are disabled.
This commit is contained in:
Marius Stanciu
2019-05-01 12:29:47 +03:00
committed by Marius
parent dc64f8174e
commit f172d5b765
4 changed files with 62 additions and 2 deletions

View File

@@ -379,9 +379,10 @@ class ObjectCollection(QtCore.QAbstractItemModel):
if role == Qt.ForegroundRole:
color = QColor(self.app.defaults['global_proj_item_color'])
color_disabled = QColor(self.app.defaults['global_proj_item_dis_color'])
obj = index.internalPointer().obj
if obj:
return QtGui.QBrush(color) if obj.options["plot"] else QtGui.QBrush(QtCore.Qt.lightGray)
return QtGui.QBrush(color) if obj.options["plot"] else QtGui.QBrush(color_disabled)
else:
return index.internalPointer().data(index.column())
@@ -765,4 +766,4 @@ class ObjectCollection(QtCore.QAbstractItemModel):
return obj_list
def update_view(self):
self.dataChanged.emit(QtCore.QModelIndex(), QtCore.QModelIndex(), [QtCore.Qt.EditRole])
self.dataChanged.emit(QtCore.QModelIndex(), QtCore.QModelIndex())