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 _interactive_color_dialog(callback):
    from PySide.QtGui import QColorDialog
    
    dialog = QColorDialog()
    
    dialog.currentColorChanged.connect(callback)
    dialog.show()
    return dialog
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(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.º 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():
    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.º 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():
    # 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_()
	def showColorDialog(self):
		color = QColorDialog.getColor()
		if not color.isValid():
			return
		rgba = list(color.getRgbF())
		self.node.color = [rgba[0], rgba[1], rgba[2]]
		self.colorButton.setColor(self.node.color)
		self.nodeUpdated.emit(self.node)
 def showColorDialog(self):
     color = QColorDialog.getColor()
     if not color.isValid():
         return
     rgba = list(color.getRgbF())
     self.node.color = [rgba[0], rgba[1], rgba[2]]
     self.colorButton.setColor(self.node.color)
     self.nodeUpdated.emit(self.node)
	def showColorDialog(self):
		color = QColorDialog.getColor()
		if not color.isValid():
			return
		rgba = list(color.getRgbF())

		self.colorButton.setColor(rgba[0:3])
		self.color = self.colorButton.color
		self.valueChanged.emit(self.color)
Ejemplo n.º 12
0
    def showColorDialog(self):
        color = QColorDialog.getColor()
        if not color.isValid():
            return
        rgba = list(color.getRgbF())

        self.colorButton.setColor(rgba[0:3])
        self.color = self.colorButton.color
        self.valueChanged.emit(self.color)
Ejemplo n.º 13
0
 def editorEvent( self, event, model, option, index ):
     column = GridManagerColumns.Columns[index.column()]
     # The only situation that we are looking at right now, is when we click at the button in the Color Column.
     if( (column == GridManagerColumns.Color) and (event.type() == QEvent.MouseButtonRelease) ):
         button_rect = self._get_color_picker_button_dimensions(option.rect)
         # If the user click inside the area of the button, we show the QColorDialog and use the color returned =]
         if( button_rect.contains( event.pos() ) ):
             self._color = QColorDialog.getColor()
             # There must be a better way to update the model, however, I found that this workaround works pretty well >.<
             # I'm still learning this s**t :P
             self.setModelData( None, model, index )
     return super(VoxelGridDelegate, self).editorEvent(event, model, option, index)
Ejemplo n.º 14
0
    def get_color(self):
        """
        Raise a QColorDialog and apply the color to the background color of the button
        """
        dial = QColorDialog()
        dial.setOptions(QColorDialog.DontUseNativeDialog)
        res = dial.exec_()

        if res:
            rgb = dial.currentColor().red(), dial.currentColor().green(
            ), dial.currentColor().blue()
            self.setColor(rgb)
            rgb = [c / 255.0 for c in rgb]
            self.colorChanged.emit(rgb)
Ejemplo n.º 15
0
    def get_color(self):
        """
        Raise a QColorDialog and apply the color to the background color of the button
        """
        dial = QColorDialog()
        dial.setOptions(QColorDialog.DontUseNativeDialog)
        res = dial.exec_()

        if res:
            rgb = dial.currentColor().red(), dial.currentColor().green(), dial.currentColor().blue()
            self.setColor(rgb)
            rgb = [c / 255.0 for c in rgb]
            self.colorChanged.emit(rgb)
Ejemplo n.º 16
0
 def colorChooserClicked(self, textfield):
     """
     QT Slot handles when a color chooser is clicked.
     
     Parameter :
     
     - textfield : The QLineEdit where to output the name of the choosen color.
     """
     color = textfield.text()
     colorChooser = QColorDialog(self)
     if color:
         colorChooser.setCurrentColor(QColor(color))
     if colorChooser.exec_():
         ret = colorChooser.currentColor()
         if ret is not None and ret.isValid():
             color = ret.name()
     self.updateColorField(textfield, color)
Ejemplo n.º 17
0
 def on_button_clicked(self):
     """Respond to button clicked event (callback)."""
     color = QColorDialog.getColor(initial=self.color)
     if color.isValid():
         self.color = color
         self._set_icon(color)
Ejemplo n.º 18
0
 def chooseColor(self, button, option):
     """The user modifies an UI background color."""
     color = QColorDialog.getColor()
     if color.isValid():
         button.setPalette(QPalette(color))
         self.config.set('Appearance', option, color.name())
Ejemplo n.º 19
0
 def choose_color(self):
     color = QColorDialog().getColor()
     if color.isValid():
         self.color = color
         self.setStyleSheet("border: 1px solid black; background: "+color.name())
Ejemplo n.º 20
0
 def change_line_color(self,color=None):
     if color==None:color=QColorDialog.getColor()
     if color.isValid():
         self.curve.setPen(color)
Ejemplo n.º 21
0
 def change_line_color(self):
     color = QColorDialog.getColor()
     if color.isValid():
         self.linecolor = color
Ejemplo n.º 22
0
 def change_point_color(self):
     color = QColorDialog.getColor()
     if color.isValid():
         self.pointcolor = color
Ejemplo n.º 23
0
 def change_point_color(self,color=None):
     if color==None:color=QColorDialog.getColor()
     if color.isValid():
         self.curve.setSymbolBrush(color)
 def changeColor(self, row, column):
     if column == 1:
         col = QColorDialog.getColor()
         parametricPulseGraph.COLOR_MAP[self.window.categoryTable.item(row,0).text()] = col
         self.window.categoryTable.item(row,1).setBackground(col)
         self.multiPanel.scene.update()