LysSubWindow

class lys.widgets.mdi.LysSubWindow(floating=False)[source]

Bases: QMdiSubWindow

LysSubWindow is customized QMdiSubWindow, which implement some usuful methods and signals.

When a LysSavedWindow is instantiated, it is automatically added to current MdiArea.

It is recommended to inherit this class when developers implement new sub windows in lys.

User input on several QWidgets can be saved and restored from file. See saveSettings() and restoreSettings() for detail.

LysSubWindow can be attached to different LysSubWindow. See attach() for detail.

Parameters

floating (bool) – Whether the window in in the current mdi area, or floating out side the medi area.

attach(parent)[source]

Attach this window to parent

After it is attached, the window follows the parent widget automatically.

This functionarity is usually used for several setting widgets, which should follow the parent (such as Graph)

However, in the recent release of lys, it is recommended to use sidebar instead of attached window.

Parameters

parent (LysSubWindow) – The window to which this window is attached.

attachTo()[source]

Attach self to pre-registered parent by attach().

When the parent window is move programatically by move(), the window does not follow.

Developers should call this method to intentionally attach it to parent.

closeEvent(event)[source]

Reimplementation of closeEvent in QMdiSubWindow

closed

closed signal is emitted when the window is closed.

eventFilter(object, event)[source]

Implementation of eventFilter in LysSubWindow.

focused

focused signal is emitted when the window is focused.

isFloating()[source]

Return if the window is out of the mdi window or not

loaded

loaded signal is emitted when the loadSettings method is called. User settings can be restored from dictionary.

moveEvent(event)[source]

Reimplementation of moveEvent in QMdiSubWindow

moveFinished

moveFinished signal is emitted when the move of the window is finished.

moved

moved signal is emitted when the window is moved.

resizeEvent(event)[source]

Reimplementation of resizeEvent in QMdiSubWindow

resizeFinished

resizedFinished signal is emitted when the resize of the window is finished.

resized

resized signal is emitted when the window is resized.

restoreSettings(file)[source]

Import all widgets settings from default setting file specified by name. User input on various widgets are easily exported to file by saveSettings().

saveSettings(file)[source]

Export all widgets settings from default setting file specified by name. User input on various widgets are easily loaded from file by restoreSettings().

saved

saved signal is emitted when the saveSettings method is called. User settings can be stored in dictionary.

setSettingFile(file)[source]

Enable automatic setting storing by saveSettings. restoreSettings will be called when this functions is called.

setTitleColor(color)[source]

Set the title color of the mdi window. :param color: The title color. :type color: QColor

property titleColor