RQBool

class pyreaqtive.models.rqbool.RQBool(state)

Bases: pyreaqtive.models.rqmodel.RQModel

Reactive Boolean Model

Represents a Boolean

Parameters

state (bool) –

__init__(state)

Constructor

Parameters

state (bool) – Initial state of the model

_bool: bool

Model store variable

get()

Get value of the model

Returns

value of the model

Return type

bool

set(value)

Set value of model

Will propagate the change to the widgets linked to the model

Parameters

value (bool) – new value of the model

Return type

None

toggle()

Toggle the value of the model

Return type

None

__bool__()

Get value of the model in bool format

Returns

value of the model

Return type

bool

__str__()

Get value of the model in string format

Returns

value of the model converted to string

Return type

str

class pyreaqtive.models.rqbool.RQComputedBool(function, **kwargs)

Bases: pyreaqtive.models.rqmodel.RQComputedModel, pyreaqtive.models.rqbool.RQBool

Reactive Computed Boolean Model

Parameters
__init__(function, **kwargs)

Constructor

Parameters
  • function (Callable) – function to calculate the model value from input values

  • **kwargs – reactive models in the function by variable name as keyword Changes in these models will trigger recalculation of the function

  • kwargs (pyreaqtive.models.rqmodel.RQModel) –

get()

Get the computed value

Return type

bool

_bool: bool

Model store variable