diff --git a/Orange/widgets/utils/domaineditor.py b/Orange/widgets/utils/domaineditor.py index abd0f3a9fb7..21db7fa3c9b 100644 --- a/Orange/widgets/utils/domaineditor.py +++ b/Orange/widgets/utils/domaineditor.py @@ -4,7 +4,7 @@ import scipy.sparse as sp from AnyQt.QtCore import Qt, QAbstractTableModel -from AnyQt.QtGui import QColor +from AnyQt.QtGui import QColor, QFont from AnyQt.QtWidgets import QComboBox, QTableView, QSizePolicy from Orange.data import DiscreteVariable, ContinuousVariable, StringVariable, \ @@ -43,6 +43,10 @@ class VarTableModel(QAbstractTableModel): def __init__(self, variables, *args): super().__init__(*args) self.variables = variables + self.orig_variables = variables.copy() + + def set_orig_variables(self, variables): + self.orig_variables = variables.copy() def set_variables(self, variables): self.modelAboutToBeReset.emit() @@ -76,6 +80,11 @@ def data(self, index, role): place = self.variables[row][Column.place] mapping = [Place.meta, Place.feature, Place.class_var, None] return TableModel.ColorForRole.get(mapping[place], None) + if role == Qt.FontRole: + if self.variables[row] != self.orig_variables[row]: + font = QFont() + font.setBold(True) + return font def setData(self, index, value, role): row, col = index.row(), index.column() @@ -342,6 +351,7 @@ def _get_column(self, data, source_var, source_place): def set_domain(self, domain): self.variables = self.parse_domain(domain) + self.model().set_orig_variables(self.variables) @staticmethod def parse_domain(domain):