PartSeg.common_gui.universal_gui_part

This module contains simple, useful widgets which implementation is too short to create separated files for them

class PartSeg.common_gui.universal_gui_part.ChannelComboBox[source]

Bases: QComboBox

Combobox for selecting channel index. Channel numeration starts from 1 for user and from 0 for developer

change_channels_num(num)[source]

Change number of channels

get_value()[source]

Return current channel. Starting from 0

Return type

Channel

set_value(val)[source]

Set current channel . Starting from 0

class PartSeg.common_gui.universal_gui_part.CustomDoubleSpinBox(*args, bounds=None, **kwargs)[source]

Bases: QDoubleSpinBox

Spin box for float with dynamic single steep

Parameters

bounds – Bounds for changing single step. Default value: ((0.2, 0.01), (2, 0.1), (300, 1), (1000, 10), (10000, 100)), 1000 Format: (List[(threshold, single_step)], default_single_step) the single_step is chosen by checking upper bound of threshold of current spin box value

class PartSeg.common_gui.universal_gui_part.CustomSpinBox(*args, bounds=None, **kwargs)[source]

Bases: QSpinBox

Spin box for integer with dynamic single steep

Parameters

bounds – Bounds for changing single step. Default value: ((300, 1), (1000, 10), (10000, 100)), 1000 Format: (List[(threshold, single_step)], default_single_step) the single_step is chosen by checking upper bound of threshold of current spin box value

class PartSeg.common_gui.universal_gui_part.EnumComboBox(enum, parent=None)[source]

Bases: superqt.combobox._enum_combobox.QEnumComboBox

Combobox for choose enum.Enum values

Parameters

enum (TypeVar(TypeVar, bound= <member ‘__bound__’ of ‘TypeVar’ objects>, covariant=<member ‘__covariant__’ of ‘TypeVar’ objects>, contravariant=<member ‘__contravariant__’ of ‘TypeVar’ objects>)) – Enum on which base combo box should be created. For proper showing labels overload the __str__ function of given enum.Enum

property current_choose

current value as Enum member

get_value()[source]

current value as Enum member

Return type

TypeVar(EnumType, bound= Enum)

set_value(value)[source]

Set value with Eunum or int

class PartSeg.common_gui.universal_gui_part.Hline(parent=None)[source]

Bases: QWidget

Horizontal line

paintEvent(self, a0: QPaintEvent)[source]
class PartSeg.common_gui.universal_gui_part.InfoLabel(text_list, delay=10000, parent=None)[source]

Bases: QWidget

Label for cyclic showing text from list. It uses ProgressCircle to inform user abu time to change text.

Parameters
  • text_list (List[str]) – texts to be in cyclic use

  • delay (int) – time in milliseconds between changes

  • parent – passed to QWidget constructor

change_text()[source]

Change text in cyclic mode

enterEvent(_)[source]

stop timer

hideEvent(_)[source]

Stop timer

leaveEvent(_)[source]

Start timer

mouseDoubleClickEvent(_)[source]

Force change text

showEvent(_)[source]

Start timer

class PartSeg.common_gui.universal_gui_part.MguiChannelComboBox(**kwargs)[source]

Bases: magicgui.widgets.ComboBox

Combobox for selecting channel index. Channel numeration starts from 1 for user and from 0 for developer

change_channels_num(num)[source]

Change number of channels

class PartSeg.common_gui.universal_gui_part.ProgressCircle(background='white', main_color='darkCyan', parent=None)[source]

Bases: QWidget

This is widget for generating circuital progress bar

Parameters
  • background (QColor) – color of background circle, need to be acceptable by QColor constructor.

  • main_color (QColor) – color of progress marking, need to be acceptable by QColor constructor.

Warning

This widget currently have no minimum size. You need to specify it in your code

paintEvent(event)[source]
set_fraction(nominator, denominator=1)[source]

Set fraction.

Parameters
  • nominator – of fraction if denominator is set to 1 then nominator should be from range [0, 1]

  • denominator – as name

class PartSeg.common_gui.universal_gui_part.Spacing(title, data_sequence, unit, parent=None, input_type=<class 'PyQt5.QtWidgets.QDoubleSpinBox'>, data_range=(0, 100000))[source]

Bases: QWidget

class PartSeg.common_gui.universal_gui_part.TextShow(lines=5, text='', parent=None)[source]

Bases: QTextEdit

Show text with word wrap and scroll if needed. Limit to show first lines without scroll bar.

height(self) int[source]
sizeHint(self) QSize[source]