本文整理汇总了Python中customeditor.CustomEditor.set_value方法的典型用法代码示例。如果您正苦于以下问题:Python CustomEditor.set_value方法的具体用法?Python CustomEditor.set_value怎么用?Python CustomEditor.set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类customeditor.CustomEditor
的用法示例。
在下文中一共展示了CustomEditor.set_value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value is None:
self.spinBox.lineEdit().setText('')
else:
value = str(value).replace(',', '.')
self.spinBox.setValue(eval(value))
示例2: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
""":param value: either ValueLoading, or a function that returns None
or the entity to be shown in the editor"""
self._last_highlighted_entity_getter = None
value = CustomEditor.set_value(self, value)
if value:
self.setEntity(value, propagate = False)
示例3: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value:
color = QtGui.QColor()
color.setRgb(*value)
self.setColor(color)
else:
self.setColor(value)
示例4: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value:
self.spinBox.setValue( float(value) )
elif value == None:
self.spinBox.lineEdit().setText('')
else:
self.spinBox.setValue(0.0)
示例5: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value) or 0
self.stars = int(value)
for i in range(self.starCount):
if i+1 <= self.stars:
self.buttons[i].setIcon(self.star_icon.getQIcon())
else:
self.buttons[i].setIcon(self.no_star_icon.getQIcon())
示例6: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
return CustomEditor.get_value(self) or value
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value:
self.dateedit.set_value(value.date())
self.timeedit.lineEdit().setText('%02i:%02i'%(value.hour, value.minute))
else:
示例7: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value) or 'face-plain'
self.img = value
#self.imgPath = 'tango/16x16/emotes/' + self.img + '.png'
for i, smiley in enumerate(self.allSmileys):
if smiley == self.img:
self.box.setCurrentIndex(i)
示例8: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value:
self.filename.setText( value )
else:
self.filename.setText( '' )
self.valueChanged.emit()
return value
示例9: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value( self, model ):
model = CustomEditor.set_value( self, model )
table = self.findChild(QtGui.QWidget, 'table')
if table and model and model != self.model:
self.model = model
table.setModel( model )
register.register( self.model, table )
post( model._extend_cache, self.update_delegates )
示例10: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value!=None:
if unicode(self.textedit.toHtml())!=value:
self.update_alignment()
self.textedit.setHtml(value)
self.update_color()
else:
self.textedit.clear()
示例11: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
if value:
old_value = self.get_value()
if value!=old_value:
for part_editor, part in zip(self.part_editors, value):
part_editor.setText(unicode(part))
else:
for part_editor in self.part_editors:
part_editor.setText(u'')
示例12: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
self.setProperty( 'value', QtCore.QVariant( value ) )
if value:
qdate = QtCore.QDate(value)
formatted_date = qdate.toString(self.date_format)
self.line_edit.set_user_input(formatted_date)
self.calendar_widget.setSelectedDate(qdate)
else:
self.line_edit.set_user_input('')
self.valueChanged.emit()
示例13: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
assert object_thread( self )
value = CustomEditor.set_value(self, value)
if value:
old_value = self.get_value()
if value!=old_value:
for part_editor, part in zip( self._get_part_editors(), value ):
part_editor.setText(unicode(part))
else:
for part_editor in self._get_part_editors():
part_editor.setText('')
示例14: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, model):
model = CustomEditor.set_value(self, model)
table = self.findChild(QtGui.QWidget, "table")
if table and model and model != self.model:
self.model = model
table.setModel(model)
register.register(self.model, table)
model_context = self.gui_context.create_model_context()
for toolbar in self.findChildren(QtGui.QToolBar):
for qaction in toolbar.actions():
post(qaction.action.get_state, qaction.set_state, args=(model_context,))
post(model._extend_cache, self.update_delegates)
示例15: set_value
# 需要导入模块: from customeditor import CustomEditor [as 别名]
# 或者: from customeditor.CustomEditor import set_value [as 别名]
def set_value(self, value):
value = CustomEditor.set_value(self, value)
self.value = value
if value:
self.save_as_button.setVisible(True)
self.filename.setText(value.verbose_name)
self.open_button.setIcon(self.open_icon)
self.open_button.setToolTip(_('open file'))
else:
self.save_as_button.setVisible(False)
self.filename.setText('')
self.open_button.setIcon(self.new_icon)
self.open_button.setToolTip(_('add file'))
self.set_tab_order()
return value