DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window classes belonging to a module derived from ModuleBase
have to derive from this class.
More...
Public Member Functions | |
QModuleWidget (QModuleBase &Owner, QWidget *Parent=nullptr) | |
Constructs a QModuleWidget instance. More... | |
~QModuleWidget ()=default | |
const auto & | GetOwner () const noexcept |
Getter for the owning module. More... | |
Qt::WindowFlags | GetQtWindowFlags () const noexcept |
Depending on thr return value of AllowResize() , returns either the return value of GetQtWindowFlagsResizable() or GetQtWindowFlagsNonResizable() . More... | |
std::string | GetDataSaveDirectory () const |
Recalls a path where modules might save recorded data to. Used by Util::PromptSaveFilePathModule() to recall the directory the user has chosen last for saving a file. This directory is the same across all modules. More... | |
void | SetDataSaveDirectory (std::string_view Directory) const |
Sets a path where modules might save recorded data to. Used by Util::PromptSaveFilePathModule() to store the directory the user has chosen last for saving a file. This directory is the same across all modules. More... | |
Override | |
Override by derived classes. | |
virtual bool | AllowResize () const noexcept |
Indicates the resizing behavior of the user interface window. Override to adjust. More... | |
Static Public Member Functions | |
constexpr static Qt::WindowFlags | GetQtWindowFlagsResizable () |
Default Qt window flags for resizable module windows. More... | |
constexpr static Qt::WindowFlags | GetQtWindowFlagsNonResizable () |
Default Qt window flags for non-resizable module windows. More... | |
Private Slots | |
void | OnDockWindow () |
Qt slot called when DockWindowShortcut is activated, calls QModuleBase::DockUndockWindow(). More... | |
void | OnFocusWindow () |
Qt slot called when QModuleBase::ModuleWindowFocusAction is triggered, calls QModuleBase::SetFocus(). More... | |
void | OnFocusMainWindow () |
Qt slot called when FocusMainWindowShortcut is activated, calls QModuleBase::FocusMainWindow(). More... | |
Private Member Functions | |
void | EnableDockWindowShortcut (bool Enable) noexcept |
Enables/disables DockWindowShortcut. More... | |
virtual void | closeEvent (QCloseEvent *Event) override |
Qt event indicating that the module window is closed. Asks the user whether to terminate the module. This Qt event is only triggered when the module window is contained in DynExpManager's QMdiArea. More... | |
Private Attributes | |
QModuleBase & | Owner |
Module owning this user interface window (reference, because it should never change nor be nullptr ). More... | |
DynExpManager * | DynExpMgr |
DynExp's main window (pointer, because it is set later by QModuleBase::InitUI()). More... | |
QShortcut * | DockWindowShortcut |
Shortcut (Ctrl + D) to dock/undock a module window to/from DynExp's main window. More... | |
QShortcut * | FocusMainWindowShortcut |
Shortcut (Ctrl + 0) to activate/focus DynExp's main window. More... | |
Friends | |
class | QModuleBase |
Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window classes belonging to a module derived from ModuleBase
have to derive from this class.
DynExp::QModuleWidget::QModuleWidget | ( | QModuleBase & | Owner, |
QWidget * | Parent = nullptr |
||
) |
Constructs a QModuleWidget
instance.
Owner | Module owning this user interface window. |
Parent | Parent Qt widget of this user interface window. There is no need to pass anything else than nullptr here. |
Definition at line 417 of file Module.cpp.
|
default |
|
inlinevirtualnoexcept |
Indicates the resizing behavior of the user interface window. Override to adjust.
Reimplemented in DynExpModule::Widefield::WidefieldMicroscopeWidget, DynExpModule::Trajectory1DWidget, DynExpModule::SpectrumViewer::SpectrumViewerWidget, DynExpModule::SignalPlotterWidget, DynExpModule::SignalDesignerWidget, DynExpModule::ODMR::ODMRWidget, DynExpModule::LockinAmplifierControlWidget, and DynExpModule::ImageViewer::ImageViewerWidget.
|
overrideprivatevirtual |
Qt event indicating that the module window is closed. Asks the user whether to terminate the module. This Qt event is only triggered when the module window is contained in DynExpManager's
QMdiArea.
Event | Refer to Qt documentation. |
Definition at line 446 of file Module.cpp.
|
privatenoexcept |
Enables/disables DockWindowShortcut.
Enable | Pass true to enable DockWindowShortcut, false to disable DockWindowShortcut. |
Definition at line 441 of file Module.cpp.
std::string DynExp::QModuleWidget::GetDataSaveDirectory | ( | ) | const |
Recalls a path where modules might save recorded data to. Used by Util::PromptSaveFilePathModule() to recall the directory the user has chosen last for saving a file. This directory is the same across all modules.
Definition at line 431 of file Module.cpp.
|
inlinenoexcept |
|
noexcept |
Depending on thr return value of AllowResize()
, returns either the return value of GetQtWindowFlagsResizable()
or GetQtWindowFlagsNonResizable()
.
Qt::WindowFlags
. Definition at line 426 of file Module.cpp.
|
staticconstexpr |
Default Qt window flags for non-resizable module windows.
Qt::WindowFlags
. Definition at line 411 of file Module.cpp.
|
staticconstexpr |
Default Qt window flags for resizable module windows.
Qt::WindowFlags
. Definition at line 405 of file Module.cpp.
|
privateslot |
Qt slot called when DockWindowShortcut is activated, calls QModuleBase::DockUndockWindow().
Definition at line 462 of file Module.cpp.
|
privateslot |
Qt slot called when FocusMainWindowShortcut is activated, calls QModuleBase::FocusMainWindow().
Definition at line 472 of file Module.cpp.
|
privateslot |
Qt slot called when QModuleBase::ModuleWindowFocusAction is triggered, calls QModuleBase::SetFocus().
Definition at line 467 of file Module.cpp.
void DynExp::QModuleWidget::SetDataSaveDirectory | ( | std::string_view | Directory | ) | const |
Sets a path where modules might save recorded data to. Used by Util::PromptSaveFilePathModule() to store the directory the user has chosen last for saving a file. This directory is the same across all modules.
Directory | Path to show by default in the modules' file open/save dialogs. |
Definition at line 436 of file Module.cpp.
|
friend |
|
private |
|
private |
DynExp's main window (pointer, because it is set later by QModuleBase::InitUI()).
|
private |
|
private |