nexxT.services.gui.MainWindow module

This module provides a MainWindow GUI service for the nexxT framework.

class nexxT.services.gui.MainWindow.MainWindow(config)[source]

Bases: QMainWindow

Main Window service for the nexxT frameworks. Other services usually create dock windows, filters use the subplot functionality to create grid-layouted views.

__init__(self, /, parent: PySide6.QtWidgets.QWidget | None = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags), *, iconSize: PySide6.QtCore.QSize | None = None, toolButtonStyle: PySide6.QtCore.Qt.ToolButtonStyle | None = None, animated: bool | None = None, documentMode: bool | None = None, tabShape: PySide6.QtWidgets.QTabWidget.TabShape | None = None, dockNestingEnabled: bool | None = None, dockOptions: PySide6.QtWidgets.QMainWindow.DockOption | None = None, unifiedTitleAndToolBarOnMac: bool | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

aboutToClose
closeEvent(closeEvent)[source]

Override from QMainWindow, saves the state.

Parameters:

closeEvent – a QCloseEvent instance

Returns:

deferredUpdate(obj, slotName)[source]

Call this method to defer a call to the sepcified slot (obj->slotName()) in accordance with the user-defined framerate set. The slot will be called via getattr(obj, slotName)()

Parameters:
  • obj – A QObject instance

  • slotName – The name of the slot.

eventFilter(obj, event)[source]

Overwritten from QObject, for disabling mouse wheel scrolling on the main widget’s viewport

getToolBar()[source]

Get the main toolbar (adds seperators as appropriate).

Returns:

ignoreCloseEvent()[source]

Can be called in slots connected to aboutToClose for requesting to ignore the event. Use case is the “There are unsaved changes” dialog.

Returns:

mdiSubWindowCreated
newDockWidget(name, parent, defaultArea, allowedArea=<DockWidgetArea.BottomDockWidgetArea|LeftDockWidgetArea: 9>, defaultLoc=None)[source]

This function is supposed to be called by services

Parameters:
  • name – the name of the dock window

  • parent – the parent (usually None)

  • defaultArea – the default dock area

  • allowedArea – the allowed dock areas

Returns:

a new QDockWindow instance

newMdiSubWindow(filterOrService, windowTitle=None)[source]

Deprectated (use subplot(…) instead): This function is supposed to be called by filters.

Parameters:
  • filterOrService – a Filter instance

  • windowTitle – the title of the window (might be None)

Returns:

a new QMdiSubWindow instance

static parseWindowId(windowId)[source]

convers a subplot window id into windowTitle, row and column

Parameters:

windowId – the window id

Returns:

title, row, column

releaseSubplot(arg)[source]

This needs to be called to release the previously allocated subplot called windowId. The managed widget is deleted as a consequence of this function.

Parameters:

arg – the widget as passed to subplot. Passing the windowId is also supported, but deprecated.

Returns:

restoreConfigSpecifics()[source]

restores the config-specific state of the main window.

restoreState()[source]

restores the state of the main window including the dock windows of Services

Returns:

saveConfigSpecifics()[source]

saves the config-specific state of the main window.

saveMdiState()[source]

saves the state of the individual MDI windows

Returns:

saveState()[source]

saves the state of the main window including the dock windows of Services

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("MainWindow" inherits "QMainWindow": Methods:   #39 type=Signal, signature=mdiSubWindowCreated(QMdiSubWindow*), parameters=QMdiSubWindow*   #40 type=Signal, signature=aboutToClose(PyObject), parameters=PyObject   #41 type=Signal, signature=userSelectionChanged(QString,QPoint), parameters=QString, QPoint   #42 type=Slot, signature=deferredUpdate(QObject*,QString), parameters=QObject*, QString   #43 type=Slot, signature=_closeAllPlots()   #44 type=Slot, signature=_showAllPlots()   #45 type=Slot, signature=updateSelection(QString,QPoint), parameters=QString, QPoint   #46 type=Slot, signature=getToolBar()   #47 type=Slot, signature=newDockWidget(QString,QObject*,int,int), parameters=QString, QObject*, int, int   #48 type=Slot, signature=subplot(QString,QObject*,QWidget*), parameters=QString, QObject*, QWidget*   #49 type=Slot, signature=releaseSubplot(QString), parameters=QString   #50 type=Slot, signature=releaseSubplot(QWidget*), parameters=QWidget*   #51 type=Slot, signature=newMdiSubWindow(QObject*,QString), parameters=QObject*, QString   #52 type=Slot, signature=newMdiSubWindow(QObject*), parameters=QObject* )
subplot(windowId, theFilter, widget)[source]

Adds widget to the GridLayout specified by windowId.

Parameters:
  • windowId – a string with the format “<windowTitle>[<row>,<col>]” where <windowTitle> is the caption of the MDI window (and it is used as identifier for saving/restoring window state) and <row>, <col> are the coordinates of the addressed subplots (starting at 0)

  • theFilter – a Filter instance which is requesting the subplot

  • widget – a QWidget which shall be placed into the grid layout. Note that this widget is reparented as a result of this operation and the parents can be used to get access to the MDI sub window. Use releaseSubplot to remove the window

Returns:

None

updateSelection(group, point)[source]

QT Meta-function which can be called to update the 2D selection.

Parameters:
  • group – the group name given as str/QString

  • point – the new selection point given as QPoint

userSelectionChanged
class nexxT.services.gui.MainWindow.NexxTDockWidget[source]

Bases: QDockWidget

Need subclassing for getting close / show events

closeEvent(closeEvent)[source]

override from QMdiSubWindow

Parameters:

closeEvent – a QCloseEvent instance

Returns:

showEvent(showEvent)[source]

override from QMdiSubWindow

Parameters:

closeEvent – a QShowEvent instance

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("NexxTDockWidget" inherits "QDockWidget": Methods:   #38 type=Signal, signature=visibleChanged(bool), parameters=bool )
visibleChanged
class nexxT.services.gui.MainWindow.NexxTMdiSubWindow[source]

Bases: QMdiSubWindow

Need subclassing for getting close / show events and saving / restoring state.

closeEvent(closeEvent)[source]

override from QMdiSubWindow

Parameters:

closeEvent – a QCloseEvent instance

Returns:

restoreGeometry(geometry)[source]

Restores the geometry of this subwindow

Parameters:

geometry – the saved state as a QByteArray instance

Returns:

saveGeometry()[source]

Saves the geometry of this subwindow (see https://bugreports.qt.io/browse/QTBUG-18648)

Returns:

a ByteArray instance

showEvent(showEvent)[source]

override from QMdiSubWindow

Parameters:

closeEvent – a QShowEvent instance

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("NexxTMdiSubWindow" inherits "QMdiSubWindow": Methods:   #40 type=Signal, signature=visibleChanged(bool), parameters=bool )
visibleChanged