Exemplo n.º 1
0
 def setQuantity(self, value):
     'Set the Quantity'
     if not value in quantities():
         raise KeyError('Unknown Unit Quantity %s' % value)
     
     self._quantity = value
     self._units = read_setting('%s_units' % self._quantity)
Exemplo n.º 2
0
    def __init__(self, quantity, default=None, showAbbr=True, parent=None):
        super(UnitsDelegate, self).__init__(parent)

        self._quantity = quantity
        self._default = default
        self._showAbbr = showAbbr

        if not quantity in quantities():
            raise KeyError("Unknown Unit Quantity %s" % quantity)
Exemplo n.º 3
0
 def __init__(self, quantity, units=None, parent=None):
     super(QuantityEdit, self).__init__(parent)
     
     self._quantity = quantity
     self._units = units
     
     if not quantity in quantities():
         raise KeyError('Unknown Unit Quantity %s' % quantity)
     
     if self._units is None:
         self._units = read_setting('%s_units' % self._quantity)
     
     self.setValidator(QDoubleValidator(parent))