def set_style(self): # tab_label = QtGui.QLabel(tab_name) # tab_label.setAlignment(QtCore.Qt.AlignCenter) # tab_color = stype.info['color'] button_color = '0000ff' if button_color: effect = QtGui.QGraphicsDropShadowEffect(self.childrenToolButton) # blur = QtGui.QGraphicsBlurEffect(tab_label) # QtGui.QGraphicsItemAnimation t_c = gf.hex_to_rgb(button_color, alpha=255, tuple=True) # print t_c effect.setOffset(1, 1) effect.setColor(QtGui.QColor(t_c[0], t_c[1], t_c[2], t_c[3])) # blur.setColor(QtGui.QColor(t_c[0], t_c[1], t_c[2], t_c[3])) # print blur.strength() # blur.setStrength(.5) # blur.setBlurRadius() # print blur.blurHints() # print blur.blurRadius() # blur.setBlurRadius(2) effect.setBlurRadius(20) self.childrenToolButton.setGraphicsEffect(effect) # tab_label.setGraphicsEffect(blur) # tab_color_rgb = gf.hex_to_rgb(button_color, alpha=8) self.childrenToolButton.setStyleSheet('QToolButton {background-color: transparent;}')
def fill_status(self): status_combo_box = self.statusComboBox.model() for value, color in zip(self.task_process['process'], self.task_process['color']): item = QtGui.QStandardItem(u'{0}'.format(value)) sc = gf.hex_to_rgb(color, tuple=True) sc_item = QtGui.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)
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)
def create_serachline(self): effect = QtGui.QGraphicsDropShadowEffect(self.searchLineEdit) effect.setOffset(2, 2) tab_color = self.stype.info['color'] if tab_color: t_c = gf.hex_to_rgb(tab_color, alpha=128, tuple=True) effect.setColor(QtGui.QColor(t_c[0], t_c[1], t_c[2], t_c[3])) effect.setBlurRadius(15) else: effect.setColor(QtGui.QColor(0, 0, 0, 96)) effect.setBlurRadius(5) self.searchLineEdit.setGraphicsEffect(effect)