| |>>> # create connections |>>> def printColor(clr): print clr.red(), clr.green(), clr.blue() |>>> btn.colorChanged.connect(printColor) | |>>> # prompt the user to select a color for that button |>>> btn.pickColor() """
def pickTextColor(self): """ Prompts the user to select a text color. """ clr = QColorDialog.getColor(self.textColor(), self.window(), "Pick Text Color") if clr.isValid(): self.setTextColor(clr)
def pickColor(self): """ Prompts the user to select a color for this button. """ color = QColorDialog.getColor(self.color(), self) if (color.isValid()): self.setColor(color)
def pickTextColor(self): """ Prompts the user to select a text color. """ clr = QColorDialog.getColor(self.textColor(), self.window(), 'Pick Text Color') if clr.isValid(): self.setTextColor(clr)
def editColor( self, item, index ): """ Prompts the user to pick a new color for the inputed item/column. :param item | <XColorTreeWidgetItem> index | <int> """ if ( not index ): return newcolor = QColorDialog.getColor(item.colorAt(index-1), self) if ( not newcolor.isValid() ): return endIndex = index + 1 if ( self.propogateRight() ): endIndex = self.columnCount() for i in range(index, endIndex): item.setColorAt(i-1, newcolor)