spacr.qt.widgets.percentile_pair¶
Two numeric fields for the low and high ends of a percentile window.
A percentile window is two numbers, so it is entered as two fields. Typed
into one box it is a parsing problem: [1, 99] and [1 99] have the
same intent, and a single text field would have to accept both spellings.
The stored value does not change. PercentilePair.value() answers the
[low, high] list every settings file already holds, and
spacr.picture_settings.percentile_pair() reads both that and every text
spelling that reached disk before this control existed – so an old settings
CSV opens on the pair it recorded instead of being refused.
Classes¶
The low and high ends of a percentile window, as two spin boxes. |
Module Contents¶
- class spacr.qt.widgets.percentile_pair.PercentilePair(value: Any = None, parent: PySide6.QtWidgets.QWidget | None = None)[source]¶
Bases:
PySide6.QtWidgets.QWidgetThe low and high ends of a percentile window, as two spin boxes.
The two fields constrain each other rather than validating after the fact: the high field cannot go below the low one and the low field cannot go above the high one, so an inverted window is not a value the panel can be left holding.
Build the pair.
- Parameters:
value – the starting window, in any spelling
spacr.picture_settings.percentile_pair()accepts.parent – the owning widget.
- setText(value: Any) None[source]¶
Set both percentiles from one settings string.
Named for QLineEdit’s method for the same reason as
ChannelPicker.setText().- Parameters:
value – the pair, as the settings dict spells it.