PropertyWidget
PropertyWidget
#
Bases: QWidget
A widget to display and control a specified mmcore device property.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
device_label
|
str
|
Device label |
required |
prop_name
|
str
|
Property name |
required |
parent
|
QWidget | None
|
Optional parent widget. By default, None. |
None
|
mmcore
|
CMMCorePlus | None
|
Optional |
None
|
connect_core
|
bool
|
Whether to connect the widget to the core. If False, the widget will not update the core when the value changes. By default, True. |
True
|
Raises:
Type | Description |
---|---|
ValueError
|
If the |
allowedValues() -> tuple[str, ...]
#
Return tuple of allowable values if property is categorical.
connectCore(mmcore: CMMCorePlus | None = None) -> None
#
Connect to core.
Connect the widget to the core. This is the default state.
deviceType() -> DeviceType
#
Return property type.
disconnectCore() -> None
#
Disconnect from core.
Disconnect the widget from the core. This will prevent the widget from updating the core when the value changes.
isReadOnly() -> bool
#
Return True if property is read only.
propertyType() -> PropertyType
#
Return property type.
refresh() -> None
#
Update the value of the widget from mmcore.
(If all goes well this shouldn't be necessary, but if a propertyChanged event is missed, this can be used).
setValue(value: Any) -> None
#
Set the current value of the widget (which should match mmcore).
value() -> Any
#
Get value.
Return the current value of the widget (which should match mmcore).
Example#
property_widget.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|