def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value is not None: self.setText(unicode(value)) else: self.setText("") return value
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value is not None: self.setText(unicode(value)) else: self.setText('') return value
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) #if value: # self.setText(unicode(value)) #else: # self.setText('') self.setText(unicode(value)) return value
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setText(self.yes) if self.color_yes: selfpalette = self.palette() selfpalette.setColor(QtGui.QPalette.WindowText, self.color_yes) self.setPalette(selfpalette) else: self.setText(self.no) if self.color_no: selfpalette = self.palette() selfpalette.setColor(QtGui.QPalette.WindowText, self.color_no) self.setPalette(selfpalette)
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setText(self.yes) if self.color_yes: selfpalette = self.palette() selfpalette.setColor(QtGui.QPalette.WindowText, self.color_yes) self.setPalette(selfpalette) else: self.setText(self.no) if self.color_no: selfpalette = self.palette() selfpalette.setColor(QtGui.QPalette.WindowText, self.color_no) self.setPalette(selfpalette)
def set_value(self, value): """Set the current value of the combobox where value, the name displayed is the one that matches the value in the list set with set_choices""" if not sip.isdeleted(self): from camelot.core.utils import variant_to_pyobject value = AbstractCustomEditor.set_value(self, value) self.setProperty('value', QtCore.QVariant(value)) self.valueChanged.emit() if not self._value_loading and value != NotImplemented: for i in range(self.count()): if value == variant_to_pyobject(self.itemData(i)): self.setCurrentIndex(i) return # it might happen, that when we set the editor data, the set_choices # method has not happened yet, therefore, we temporary set ... in the # text while setting the correct data to the editor self.insertItem(self.count(), '...', QtCore.QVariant(value)) self.setCurrentIndex(self.count() - 1)
def set_value(self, value): """Set the current value of the combobox where value, the name displayed is the one that matches the value in the list set with set_choices""" if not sip.isdeleted(self): from camelot.core.utils import variant_to_pyobject value = AbstractCustomEditor.set_value(self, value) self.setProperty("value", QtCore.QVariant(value)) self.valueChanged.emit() if not self._value_loading and value != NotImplemented: for i in range(self.count()): if value == variant_to_pyobject(self.itemData(i)): self.setCurrentIndex(i) return # it might happen, that when we set the editor data, the set_choices # method has not happened yet, therefore, we temporary set ... in the # text while setting the correct data to the editor self.insertItem(self.count(), "...", QtCore.QVariant(value)) self.setCurrentIndex(self.count() - 1)
def set_value(self, value): """Set the current value of the combobox where value, the name displayed is the one that matches the value in the list set with set_choices""" from camelot.core.utils import variant_to_pyobject value = AbstractCustomEditor.set_value(self, value) self.setProperty( 'value', QtCore.QVariant(value) ) self.valueChanged.emit() if not self._value_loading and value != NotImplemented: for i in range(self.count()): if value == variant_to_pyobject(self.itemData(i)): self.setCurrentIndex(i) return # it might happen, that when we set the editor data, the set_choices # method has not happened yet or the choices don't contain the value # set self.setCurrentIndex( -1 ) LOGGER.error( u'Could not set value %s in field %s because it is not in the list of choices'%( unicode( value ), unicode( self.objectName() ) ) ) LOGGER.error( u'Valid choices include : ' ) for i in range(self.count()): LOGGER.error( ' - %s'%unicode(variant_to_pyobject(self.itemData(i))) )
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: locale = QtCore.QLocale( value ) self.setCurrentIndex( self.index_by_language[locale.language()] )
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setCheckState(Qt.Checked) else: self.setCheckState(Qt.Unchecked)
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setText(value)
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setTime(value) else: self.setTime(self.minimumTime())
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setCheckState(Qt.Checked) else: self.setCheckState(Qt.Unchecked)
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setText(value)
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: locale = QtCore.QLocale(value) self.setCurrentIndex(self.index_by_language[locale.language()])
def set_value(self, value): value = AbstractCustomEditor.set_value(self, value) if value: self.setTime(value) else: self.setTime(self.minimumTime())