Esempio n. 1
0
 def fill_status(self):
     status_combo_box = self.statusComboBox.model()
     for value, color in zip(self.task_process['process'],
                             self.task_process['color']):
         item = Qt4Gui.QStandardItem(u'{0}'.format(value))
         sc = gf.hex_to_rgb(color, tuple=True)
         sc_item = Qt4Gui.QColor(sc[0], sc[1], sc[2], 128)
         item.setBackground(sc_item)
         item.setData(sc_item, 1)
         item.setData(value, 2)
         status_combo_box.appendRow(item)
Esempio n. 2
0
 def fill_priority(self):
     # priority combo box with colors
     priority_combo_box = self.priorityComboBox.model()
     step = len(self.priority) - 1
     int_range = 255 / step * step
     r = range(0, int_range, 255 / step)
     g = range(0, int_range, 255 / step)
     b = 0
     a = 64
     r.reverse()
     pc = []
     for i in range(step):
         color = r[i], g[i], b, a
         pc.append(color)
     for i, (label, value) in enumerate(self.priority):
         item = Qt4Gui.QStandardItem(u'{0}, {1}'.format(label, value))
         color = Qt4Gui.QColor(pc[i - 1][0], pc[i - 1][1], pc[i - 1][2],
                               pc[i - 1][3])
         if i > 0:
             item.setBackground(color)
             item.setData(color, 1)
         priority_combo_box.appendRow(item)