Beispiel #1
0
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]
Beispiel #2
0
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]
Beispiel #3
0
 def color(self):
     return qt_to_mpl_color(self.pen().color())
Beispiel #4
0
 def color(self):
     return qt_to_mpl_color(self.node.brush().color())
Beispiel #5
0
 def color(self):
     return qt_to_mpl_color(self.pen().color())
Beispiel #6
0
 def color(self):
     return qt_to_mpl_color(self.node.brush().color())
Beispiel #7
0
 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()