def check_values_and_color(model, data, colors): for i in range(len(colors)): for j, colname in enumerate(sorted(data)): # Get index of cell idx = model.index(i, j) # Check values value = model.data(idx, Qt.DisplayRole) assert value == str(data[colname][i]) # Check colors brush = model.data(idx, Qt.BackgroundRole) if colors[i] is None: assert brush is None else: assert qt_to_mpl_color(brush.color()) == colors[i]
def check_values_and_color(model, data, colors): for i in range(len(colors)): for j, colname in enumerate(sorted(data)): # Get index of cell idx = model.index(i, j) # Check values value = model.data(idx, Qt.DisplayRole) assert value == str(data[colname][i]) # Check colors brush = model.data(idx, Qt.BackgroundRole) if colors[i] is None: assert brush is None else: assert qt_to_mpl_color(brush.color()) == colors[i]
def color(self): return qt_to_mpl_color(self.pen().color())
def color(self): return qt_to_mpl_color(self.node.brush().color())
def color(self): return qt_to_mpl_color(self.pen().color())
def color(self): return qt_to_mpl_color(self.node.brush().color())
def update_style(self): if self._edit_label: self.layer.label = self.label() self.layer.style.color = qt_to_mpl_color(self.color()) self.layer.style.alpha = self.color().alpha() / 255. self.layer.style.markersize = self.size()