labscript_utils.qtwidgets¶
Helper Widgets¶
-
class
labscript_utils.qtwidgets.dragdroptab.
DragDropTabBar
(parent, group_id)[source]¶ Bases:
labscript_utils.qtwidgets.dragdroptab._BaseDragDropTabBar
-
FLUSH_GAP
= 5¶
-
SCROLL_BUTTON_GAP
= 2¶
-
SCROLL_BUTTON_WIDTH
= 15¶
-
property
drag_in_progress
¶
-
property
dragged_tab_index
¶
-
property
dragged_tab_parent
¶
-
insertion_index_at
(pos)[source]¶ Compute at which index the tab with given upper left corner position in global coordinates should be inserted into the tabBar.
-
limbo
= None¶
-
mouseMoveEvent
(event)[source]¶ Update the parent of the tab to be the DragDropTabWidget under the mouse, if any, otherwise update it to the limbo object. Update the position of the tab in the widget it’s in.
-
mousePressEvent
(event)[source]¶ Take note of the tab that was clicked so it can be dragged on mouseMoveEvents
-
mouseReleaseEvent
(event)[source]¶ Same as mouseMove event - update the DragDropTabWidget and position of the tab to the current mouse position. Unless the mouse position is outside of any widgets at the time of mouse release, in which case move the tab to its last known parent and position.
-
set_tab_parent
(dest, index=None, pos=None)[source]¶ Move the tab to the given parent DragDropTabBar if it’s not already there. index=None will determined the insertion index from the given mouse position.
-
tab_widgets
= {}¶
-
-
class
labscript_utils.qtwidgets.dragdroptab.
DragDropTabWidget
(group_id=None, accept_drops_bar_only=False)[source]¶ Bases:
PyQt5.QtWidgets.QTabWidget
A tab widget that supports dragging and dropping of tabs between tab widgets that share a group_id. a group_id of None indicates that tab dragging is disabled.
-
class
labscript_utils.qtwidgets.dragdroptab.
Tab
(widget, text, data, text_color, tooltip, whats_this, button_left, button_right, icon)¶ Bases:
tuple
Alias for field number 6
Alias for field number 7
-
property
data
¶ Alias for field number 2
-
property
icon
¶ Alias for field number 8
-
property
text
¶ Alias for field number 1
-
property
text_color
¶ Alias for field number 3
-
property
tooltip
¶ Alias for field number 4
-
property
whats_this
¶ Alias for field number 5
-
property
widget
¶ Alias for field number 0
-
class
labscript_utils.qtwidgets.dragdroptab.
TabAnimation
(parent)[source]¶ Bases:
PyQt5.QtCore.QAbstractAnimation
-
animate_limbo
(limbo, index)[source]¶ If the floating tab in limbo is being sucked back into one of our tabs, then we can animate that by hiding the relevant tab rect off to the side somwhere whilst the floating tab swoops in.
-
tau
= 60.0¶
-
-
class
labscript_utils.qtwidgets.elide_label.
ElideScrollArea
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QScrollArea
A ScrollArea for containing a label that we want to elide. The elision is attained by just letting the text we don’t want to see be scrolled off to the side with the scrollbars hidden.
-
class
labscript_utils.qtwidgets.elide_label.
ElidedLabelContainer
(label)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
A QWidget to contain a QLabel with a single line of (possibly rich) text that we want to elide. The elision is obtained by putting the QLabel in a QScrollArea and having the QScrollarea only show the part of the text we want to see. An extra label with the elision indication “…” is also inserted next to the QScrollArea.
-
labscript_utils.qtwidgets.elide_label.
elide_label
(label, layout, elide_mode)[source]¶ Take an existing label that is in a layout, and wrap it in our widgets that elide the text, and insert it back into the layout. This is a hack that allows us to elide a QLabel with a single line of (possibly rich) text, a task that seems pretty much impossible to do in any kosher way.
This function is for modifying an existing label already in a layout, but if you are programatically creating a label, then you can wrap it in ElidedLabelContainer(label) before inserting it into a layout or other container widget, which is more flexible than this function which only works if the label is in a QBoxLayout
-
class
labscript_utils.qtwidgets.fingertab.
FingerTabBarWidget
(parent=None, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QTabBar
-
class
labscript_utils.qtwidgets.fingertab.
FingerTabWidget
(parent, *args)[source]¶ Bases:
PyQt5.QtWidgets.QTabWidget
A QTabWidget equivalent which uses our FingerTabBarWidget
-
class
labscript_utils.qtwidgets.headerview_with_widgets.
HorizontalHeaderViewWithWidgets
(model, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QHeaderView
A QHeaderView that supports inserting arbitrary widgets into sections. Use setWidget(logical_index, widget) to set and setWidget(logical_index, None) to unset. Decorations, checkboxes or anything other than text in the headers containing widgets is unsupported, and may result in garbled output
-
eventFilter
(target, event)[source]¶ Ensure we don’t leave the curor set as a resize handle when the mouse moves onto a child widget:
-
stylesheet
= '\n QHeaderView::section {\n /* Will be set dynamically: */\n padding-top: %dpx;\n padding-bottom: %dpx;\n /* Required, otherwise set to zero upon setting any stylesheet at all: */\n padding-left: 4px;\n /* Required for some reason, otherwise other settings ignored: */\n color: black;\n }\n\n /* Any other style goes here: */\n %s\n '¶
-
thinspace
= '\u2009'¶
-
-
class
labscript_utils.qtwidgets.InputPlotWindow.
PlotWindow
(*args, **kwargs)[source]¶ Bases:
zprocess.process_tree.Process
-
class
labscript_utils.qtwidgets.outputbox.
OutputBox
(container, scrollback_lines=1000)[source]¶ Bases:
qtutils.outputbox.OutputBox
A subclass of qtutils.outputbox.OutputBox configured with security from labconfig.
-
class
labscript_utils.qtwidgets.toolpalette.
ToolPalette
(parent, name, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QScrollArea
-
class
labscript_utils.qtwidgets.toolpalette.
ToolPaletteGroup
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QVBoxLayout
-
property
widths_linked
¶
-
property
Input/Output Widgets¶
-
class
labscript_utils.qtwidgets.analoginput.
AnalogInput
(device_name, hardware_name, connection_name='-', display_name=None, horizontal_alignment=False, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
-
class
labscript_utils.qtwidgets.analogoutput.
AnalogOutput
(hardware_name, connection_name='-', display_name=None, horizontal_alignment=False, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
-
property
selected_unit
¶
-
property
-
class
labscript_utils.qtwidgets.analogoutput.
NoStealFocusDoubleSpinBox
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QDoubleSpinBox
A QDoubleSpinBox that doesn’t steal focus as you scroll over it with a mouse wheel.
-
class
labscript_utils.qtwidgets.ddsoutput.
DDSOutput
(hardware_name, connection_name='-', parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
-
class
labscript_utils.qtwidgets.digitaloutput.
DigitalOutput
(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QPushButton
-
property
state
¶
-
property
-
class
labscript_utils.qtwidgets.digitaloutput.
InvertedDigitalOutput
(*args, **kwargs)[source]¶ Bases:
labscript_utils.qtwidgets.digitaloutput.DigitalOutput
-
property
state
¶
-
property
-
class
labscript_utils.qtwidgets.enumoutput.
EnumOutput
(hardware_name, connection_name='-', display_name=None, horizontal_alignment=False, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
-
property
selected_index
¶
-
property
selected_option
¶
-
property
-
class
labscript_utils.qtwidgets.imageoutput.
BrowseButton
(image_output, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QPushButton
-
class
labscript_utils.qtwidgets.imageoutput.
ImageOutput
(name, width, height, *args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
-
imageUpdated
¶
-
property
value
¶
-