def __init__(self, *args, **kws): self.sense = kws.pop('sense', True) # whether checking the box makes our value (seen by callers) True or False self.default = kws.pop('default', True) # whether our default value (*not* default checked-state) is True or False self.tooltip = kws.pop('tooltip', "") # tooltip to show ###e NIM # public attributes: self.attr = kws.pop('attr', None) # name of mode attribute (if any) which this should set self.repaintQ = kws.pop('repaintQ', False) # whether mode might need to repaint if this changes assert not kws, "keyword arguments are not supported by QCheckBox" assert len(args) is 3 assert type(args[0]) is type('abc') assert type(args[2]) is type('abc') QCheckBox.__init__(self, args[0]) self.setObjectName(args[2])
def __init__(self, *args, **kws): self.sense = kws.pop( 'sense', True ) # whether checking the box makes our value (seen by callers) True or False self.default = kws.pop( 'default', True ) # whether our default value (*not* default checked-state) is True or False self.tooltip = kws.pop('tooltip', "") # tooltip to show ###e NIM # public attributes: self.attr = kws.pop( 'attr', None) # name of mode attribute (if any) which this should set self.repaintQ = kws.pop( 'repaintQ', False) # whether mode might need to repaint if this changes assert not kws, "keyword arguments are not supported by QCheckBox" assert len(args) is 3 assert type(args[0]) is type('abc') assert type(args[2]) is type('abc') QCheckBox.__init__(self, args[0]) self.setObjectName(args[2])
def __init__(self, parentWidget, text = '', widgetColumn = 1, state = None, ##Qt.Unchecked, setAsDefault = True, spanWidth = False ): """ Appends a QCheckBox (Qt) widget to the bottom of I{parentWidget}, a Property Manager group box. @param parentWidget: The parent group box containing this widget. @type parentWidget: PM_GroupBox @param text: This property holds the text shown on the checkbox. @type text: str @param widgetColumn: The column number of the PM_CheckBox widget in the group box grid layout. The only valid values are 0 (left column) and 1 (right column). The default is 1 (right column). @type widgetColumn: int @param state: Set's the check box's check state. The default is Qt.Unchecked (unchecked). @type state: U{B{Qt.CheckState}<http://doc.trolltech.com/4/ qt.html#CheckState-enum>} @param setAsDefault: If True, will restore I{state} when the "Restore Defaults" button is clicked. @type setAsDefault: bool @param spanWidth: if True, the widget and its label will span the width of the group box. Its label will appear directly above the widget (unless the label is empty) and is left justified. @type spanWidth: bool @see: U{B{QCheckBox}<http://doc.trolltech.com/4/qcheckbox.html>} """ QCheckBox.__init__(self) self.parentWidget = parentWidget self.setText(text) self.widgetColumn = widgetColumn self.setAsDefault = setAsDefault self.spanWidth = spanWidth #Ideally, this should be simply self.setCheckState(state) with the #default state = Qt.UnChecked in the ,init argument itself. But, #apparently pylint chokes up when init argument is a Qt enum. #This problem happened while running pylint 0.23 on the SEMBOT server #so comitting this temporary workaround. The pylint on my machine is #0.25 and it runs fine even before this workaround. Similar changes made #in PM_Slider. #-- Ninad 2008-06-30 if state is None: state = Qt.Unchecked if self.setAsDefault: self.setDefaultState(state) self.setCheckState(state) parentWidget.addPmWidget(self)
def __init__(self, data, key, text, parent): QCheckBox.__init__(self, text, parent) self.data, self.key = data, key self.setChecked(data.get(key, False)) self.stateChanged.connect(self._changed)
def __init__( self, parentWidget, text='', widgetColumn=1, state=None, ##Qt.Unchecked, setAsDefault=True, spanWidth=False): """ Appends a QCheckBox (Qt) widget to the bottom of I{parentWidget}, a Property Manager group box. @param parentWidget: The parent group box containing this widget. @type parentWidget: PM_GroupBox @param text: This property holds the text shown on the checkbox. @type text: str @param widgetColumn: The column number of the PM_CheckBox widget in the group box grid layout. The only valid values are 0 (left column) and 1 (right column). The default is 1 (right column). @type widgetColumn: int @param state: Set's the check box's check state. The default is Qt.Unchecked (unchecked). @type state: U{B{Qt.CheckState}<http://doc.trolltech.com/4/ qt.html#CheckState-enum>} @param setAsDefault: If True, will restore I{state} when the "Restore Defaults" button is clicked. @type setAsDefault: bool @param spanWidth: if True, the widget and its label will span the width of the group box. Its label will appear directly above the widget (unless the label is empty) and is left justified. @type spanWidth: bool @see: U{B{QCheckBox}<http://doc.trolltech.com/4/qcheckbox.html>} """ QCheckBox.__init__(self) self.parentWidget = parentWidget self.setText(text) self.widgetColumn = widgetColumn self.setAsDefault = setAsDefault self.spanWidth = spanWidth #Ideally, this should be simply self.setCheckState(state) with the #default state = Qt.UnChecked in the ,init argument itself. But, #apparently pylint chokes up when init argument is a Qt enum. #This problem happened while running pylint 0.23 on the SEMBOT server #so comitting this temporary workaround. The pylint on my machine is #0.25 and it runs fine even before this workaround. Similar changes made #in PM_Slider. #-- Ninad 2008-06-30 if state is None: state = Qt.Unchecked if self.setAsDefault: self.setDefaultState(state) self.setCheckState(state) parentWidget.addPmWidget(self)