Trees | Indices | Help |
|
---|
|
object --+ | sip.simplewrapper --+ | sip.wrapper --+ | PyQt5.QtCore.QObject --+ | Param --+ | CompoundParam
A collection of Params that itself is a Param. Instances of this class are used as both descriptors and as return values from the descriptor. This allows sub-params to be accessed in the most natural way (i.e. param = container.param, subparam = param.subparam), since the return value of the first descriptor has the descriptors for the sub-params. To create a compound param, subclass and add params as class attributes. Example: class Coordinate(CompoundParam): x = FloatParam() y = FloatParam() z = FloatParam(4) # Specify default value Since CompoundsParams are Params, they can also be included within other compound params: class Line(CompoundParam): startpoint = Coordinate() endpoint = Coordinate(x=3, y=2) # specify default value by kwargs Signal propagation. Executing the following lines: l = Line() l.endpoint.x = 5 will result in multiple signals being emitted: l.endpoint.xChanged l.endpoint.valueChanged l.endpointChanged l.valueChanged For any nested param, the change can be detected via either the paramChagned signal or the generic valueChanged signal. For a top-level param, only the valueChanged signal will be available. Compound params can also be serialized to JSON and deserialized from JSON. WARNING: as descriptors, instances of this class will not behave normally if used as class variables.
|
|||
__metaclass__ This metaclass modifies the creation of CompoundParam instances in the following ways: |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from |
|
|||
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
The return value of a compound param is an instance of the compound param, as DataClass = self.__class__. This means the return value will also provide the same interface as the descriptor itself. The owner instance and the name of the specific paramChanged signal on the owner object is stored on the param value instance. This allows the valueChanged signals to be propagated up the chain of ownership.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 2 06:33:28 2017 | http://epydoc.sourceforge.net |