Beispiel #1
0
 |
 |>>> # 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()
 """
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
 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)