RQBool

class pyreaqtive.models.rqbool.RQBool(state: bool)

Bases: pyreaqtive.models.rqmodel.RQModel

Reactive Boolean Model

Represents a Boolean

__init__(state: bool)

Constructor

Parameters

state – Initial state of the model

_bool: bool

Model store variable

get()bool

Get value of the model

Returns

value of the model

Return type

bool

set(value: bool)None

Set value of model

Will propagate the change to the widgets linked to the model

Parameters

value – new value of the model

toggle()None

Toggle the value of the model

__bool__()bool

Get value of the model in bool format

Returns

value of the model

Return type

bool

__str__()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: Callable, **kwargs)

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

Reactive Computed Boolean Model

__init__(function: Callable, **kwargs)

Constructor

Parameters
  • function – 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

get()bool

Get the computed value

_bool: bool

Model store variable