Ejemplo n.º 1
0
 def data(self, index, role=QtCore.Qt.DisplayRole):
     if self._is_index_valid_for(index, self) and \
             role == QtCore.Qt.DecorationRole and \
             0 <= index.row() < self.colors.number_of_colors:
         return gui.createAttributePixmap("", self.colors[index.row()])
     else:
         return super().data(index, role)
Ejemplo n.º 2
0
 def data(self, index, role=QtCore.Qt.DisplayRole):
     if self._is_index_valid_for(index, self) and \
             role == QtCore.Qt.DecorationRole and \
             0 <= index.row() < self.colors.number_of_colors:
         return gui.createAttributePixmap("", self.colors[index.row()])
     else:
         return super().data(index, role)
Ejemplo n.º 3
0
 def data(self, index, role=QtCore.Qt.DisplayRole):
     if self._is_index_valid_for(index, self) and \
             role == QtCore.Qt.DecorationRole:
         rgb = self.plot.discrete_palette.getRGB(index.row())
         return gui.createAttributePixmap("", QtGui.QColor(*rgb))
     else:
         return super().data(index, role)
Ejemplo n.º 4
0
 def data(self, index, role=QtCore.Qt.DisplayRole):
     if self._is_index_valid_for(index, self) and \
             role == QtCore.Qt.DecorationRole:
         rgb = self.plot.discrete_palette.getRGB(index.row())
         return gui.createAttributePixmap("", QtGui.QColor(*rgb))
     else:
         return super().data(index, role)
Ejemplo n.º 5
0
 def data(self, index, role=Qt.DisplayRole):
     if self._is_index_valid(index) and \
             role == Qt.DecorationRole and \
             0 <= index.row() < len(self):
         return gui.createAttributePixmap("", self.colors[index.row()])
     return super().data(index, role)
Ejemplo n.º 6
0
 def data(self, index, role=Qt.DisplayRole):
     if (self._is_index_valid(index) and role == Qt.DecorationRole
             and 0 <= index.row() < self.colors.number_of_colors):
         return gui.createAttributePixmap("", self.colors[index.row()])
     return super().data(index, role)
Ejemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     if DefaultDiscModel.icon is None:
         DefaultDiscModel.icon = gui.createAttributePixmap(
             "★", QColor(0, 0, 0, 0), Qt.black)
     self.hint: VarHint = DefaultHint