Ejemplo n.º 1
0
    def pickColor(self, styleName):
        colorBtn = getattr(self.ui, styleName + "Color")
        color = QColorDialog().getColor(colorBtn.color, self, styleName + " Color", QColorDialog.ShowAlphaChannel)

        if color.isValid():
            colorBtn.setColor(color)
            self.updateDebugDrawValues(styleName)
Ejemplo n.º 2
0
 def choose_color(self):
   color  = QColorDialog().getColor()
   
   if color.isValid():
       self.button.setStyleSheet(u'background-color:' + color.name())
   else:
       msgbox = QMessageBox()
       msgbox.setWindowTitle(u'No Color was Selected')
       msgbox.exec_()
Ejemplo n.º 3
0
    def choose_color(self):
        color = QColorDialog().getColor()

        if color.isValid():
            self.button.setStyleSheet(u'background-color:' + color.name())
        else:
            msgbox = QMessageBox()
            msgbox.setWindowTitle(u'No Color was Selected')
            msgbox.exec_()
Ejemplo n.º 4
0
def choose_color():
    color  = QColorDialog().getColor()
    
    msgbox = QMessageBox()
    if color.isValid():
        pixmap = QPixmap(50, 50)
        pixmap.fill(color)
        msgbox.setWindowTitle(u'Selected Color')
        msgbox.setIconPixmap(pixmap)
    else:
        msgbox.setWindowTitle(u'No Color was Selected')
    msgbox.exec_()
Ejemplo n.º 5
0
def choose_color():
    color = QColorDialog().getColor()

    msgbox = QMessageBox()
    if color.isValid():
        pixmap = QPixmap(50, 50)
        pixmap.fill(color)
        msgbox.setWindowTitle(u'Selected Color')
        msgbox.setIconPixmap(pixmap)
    else:
        msgbox.setWindowTitle(u'No Color was Selected')
    msgbox.exec_()
Ejemplo n.º 6
0
def choose_color():
    # Select color
    color = QColorDialog().getColor()

    # Report about result of selection in QMessageBox dialog
    msgbox = QMessageBox()
    if color.isValid():
        # Create a memory image 50x50 filled with selected color to display
        # as a icon in the msgbox dialog
        pixmap = QPixmap(50, 50)
        pixmap.fill(color)
        msgbox.setWindowTitle(u'Selected Color')
        msgbox.setIconPixmap(pixmap)
    else:
        msgbox.setWindowTitle(u'No Color was Selected')
    msgbox.exec_()
Ejemplo n.º 7
0
def choose_color():
    # Select color
    color = QColorDialog().getColor()
    
    # Report about result of selection in QMessageBox dialog
    msgbox = QMessageBox()
    if color.isValid():
        # Create a memory image 50x50 filled with selected color to display
        # as a icon in the msgbox dialog
        pixmap = QPixmap(50, 50)
        pixmap.fill(color)
        msgbox.setWindowTitle(u'Selected Color')
        msgbox.setIconPixmap(pixmap)
    else:
        msgbox.setWindowTitle(u'No Color was Selected')
    msgbox.exec_()
Ejemplo n.º 8
0
 def choose_color(self):
     color = QColorDialog().getColor()
     if color.isValid():
         self.color = color
         self.setStyleSheet("border: 1px solid black; background: "+color.name())