instrumentserver.gui.misc#

Classes

AlertLabel([parent, pixmapSize])

AlertLabelGreen([parent, pixmapSize])

Expanding the functionality of the AlertLabel to add green alerts to indicate successful things

BaseDialog(parent, flags, tittleBarButtonsWidth)

Base dialog for internal purposes.

DetachableTabWidget(*args, **kwargs)

TabWidget whose tabs can be detached and moved around.

DetachedTab(contentWidget, name, *args, **kwargs)

SeparableTabBar(*args, **kwargs)

class instrumentserver.gui.misc.AlertLabel(parent: QWidget | None = None, pixmapSize: Tuple[int, int] = (20, 20))[source]#

Bases: QLabel

clearAlert() None[source]#
setAlert(message: str) None[source]#
class instrumentserver.gui.misc.AlertLabelGreen(parent: QWidget | None = None, pixmapSize: Tuple[int, int] = (20, 20))[source]#

Bases: AlertLabel

Expanding the functionality of the AlertLabel to add green alerts to indicate successful things

mouseDoubleClickEvent(self, a0: QMouseEvent | None)[source]#
mousePressEvent(self, ev: QMouseEvent | None)[source]#
setSuccssefulAlert(message: str) None[source]#
class instrumentserver.gui.misc.BaseDialog(parent: QWidget | None = None, flags: Any = <PyQt5.QtCore.Qt.WindowFlags object>, tittleBarButtonsWidth: int = 108)[source]#

Bases: QDialog

Base dialog for internal purposes. Has correct flags so that the question mark does not appear. Also overload set tittle such that the size of the window gets adjusted in a way that the tittle is not clipped.

Parameters:

tittleBarButtonsWidth – The width of pixels that the icon, the width will be set such that it is this number plus whatever the tittle is plus 15 extra pixels of margin.

setWindowTitle(self, a0: str | None)[source]#
class instrumentserver.gui.misc.DetachableTabWidget(*args: Any, **kwargs: Any)[source]#

Bases: QTabWidget

TabWidget whose tabs can be detached and moved around. You can add 2 different kind of tabs, unclosable tabs and regular tabs. To add unclosable tabs used the addUnclosableTab method, while to add closable tabs use addTab method.

addUnclosableTab(widget: QWidget, name: str) None[source]#
onAttatchTab(widget: QWidget, name: str) None[source]#

Gets called when the user closes one of the detachable windows and properly attaches the tab back.

onCloseTab(index: int, moving: bool = False) None[source]#

Closes the tab at index.

Parameters:
  • index – Closes the tab at this index

  • moving – If True, will not emit any signals.

onDetachTab(tab: int, point: QPoint) None[source]#

Gets triggered when the user drags out a tab. Opens a QMainWindow with the widget in the dragged tab.

onMoveTab(fromIndex: int, toIndex: int) None[source]#
onTabClosed#

Signal(str) Emitted when a tab got closed.

class instrumentserver.gui.misc.DetachedTab(contentWidget: QWidget, name: str, *args: Any, **kwargs: Any)[source]#

Bases: QMainWindow

closeEvent(self, a0: QCloseEvent | None)[source]#
onCloseSignal#

Signal(QtWidgets.QWidget) emitted when a tab for the instrument is closed

class instrumentserver.gui.misc.SeparableTabBar(*args: Any, **kwargs: Any)[source]#

Bases: QTabBar

dragEnterEvent(self, a0: QDragEnterEvent | None)[source]#
dropEvent(self, a0: QDropEvent | None)[source]#
mouseDoubleClickEvent(self, a0: QMouseEvent | None)[source]#
mouseMoveEvent(a0: QMouseEvent) None[source]#

Detects if the user is dragging a tab and starts the drag object.

mousePressEvent(self, a0: QMouseEvent | None)[source]#
mouseReleaseEvent(self, a0: QMouseEvent | None)[source]#
onDetachTab#

Signal(tabIndex, newPosition) Emitted when the user is dragging a tab out ofd the tab bar and should be detached.

onMoveTab#

Signal(oldIndex, newIndex) Emitted when the user is moving the tabs.