KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
MdiWindow Class Reference

MainWindowBase subclass that manages an embedded QMdiArea. More...

#include <mdiwindow.h>

+ Inheritance diagram for MdiWindow:
+ Collaboration diagram for MdiWindow:

Public Member Functions

 MdiWindow (const QString &logPrefix, QWidget *parent=nullptr)
 Construct with a log prefix and optional parent.
 
- Public Member Functions inherited from MainWindowBase
 MainWindowBase (const QString &loggingCategory, QWidget *parent=nullptr)
 Construct with a logging category and optional parent.
 
bool persistPosition () const
 Return whether the window persists its position between sessions.
 
void setPersistPosition (bool value)
 Enable or disable position persistence.
 
bool persistSize () const
 Return whether the window persists its size between sessions.
 
void setPersistSize (bool value)
 Enable or disable size persistence.
 
int type () const
 Return the application-defined window type integer.
 
void setType (int value)
 Set the application-defined window type integer.
 
QSize defaultSize () const
 Return the default window size.
 
void setDefaultSize (const QSize &value)
 Set the default window size.
 
void setDefaultSize (int width, int height)
 Set the default window size by width and height.
 
QMdiArea * parentMdiArea ()
 Return the parent QMdiArea if this window is hosted in one.
 
StatusBarstatusBar ()
 Return the built-in StatusBar widget.
 
bool formLoadComplete () const
 Return whether the form has finished loading.
 
bool formLoadFailed () const
 Return whether the form failed to load.
 

Protected Member Functions

MainWindowBaseactiveSubWindow ()
 Return the currently active sub-window's MainWindowBase.
 
virtual MdiSubWindowopenSubWindow (MainWindowBase *window, int type)
 Open a new MdiSubWindow wrapping the given MainWindowBase.
 
virtual void closeSubWindows (int type)
 Close all open sub-windows of the given type.
 
MdiSubWindowfindFirstMdiSubWindow (int type) const
 Return the first open sub-window of the given type.
 
QList< MdiSubWindow * > findMdiSubWindows (int type) const
 Return all open sub-windows of the given type.
 
QMdiArea * mdiArea ()
 Return the embedded QMdiArea.
 
virtual void subWindowClosing (MdiSubWindow *window)
 Called just before a sub-window closes (no-op by default).
 
- Protected Member Functions inherited from MainWindowBase
void initializeBase ()
 Perform base-class initialization; call from the subclass constructor.
 
void setFormLoadComplete (bool value)
 Set the form load completion flag.
 
void setFormLoadFailed (bool value)
 Set the form load failure flag.
 
virtual void moveEvent (QMoveEvent *event) override
 Persist position on move.
 
virtual void resizeEvent (QResizeEvent *event) override
 Persist size on resize.
 
virtual void showEvent (QShowEvent *event) override
 Restore geometry and complete form load on first show.
 

Additional Inherited Members

- Public Slots inherited from MainWindowBase
void showStatusBarMessage (const QString &text, const QColor &textColor, const TimeSpan &timeout=TimeSpan())
 Show a coloured status message with an optional timeout.
 
void showStatusBarMessage (const QString &text, const TimeSpan &timeout=TimeSpan())
 Show a default-coloured status message with an optional timeout.
 
void showStatusBarAnimatedProgressMessage (const QString &text, const QColor &textColor=QColor())
 Show an animated progress message in the status bar.
 
void stopStatusBarAnimation ()
 Stop any active status bar animation.
 
virtual void onPreferencesChanged ()
 Called when application preferences change; override to react.
 

Detailed Description

MainWindowBase subclass that manages an embedded QMdiArea.

MdiWindow provides helpers for opening, closing, and finding MdiSubWindow instances by type, and receives a subWindowClosing() callback when any sub-window signals that it is about to close.

Definition at line 16 of file mdiwindow.h.

Constructor & Destructor Documentation

◆ MdiWindow()

MdiWindow::MdiWindow ( const QString &  logPrefix,
QWidget *  parent = nullptr 
)

Construct with a log prefix and optional parent.

Parameters
logPrefixCategory name used for log output
parentOptional QWidget parent

Member Function Documentation

◆ activeSubWindow()

MainWindowBase * MdiWindow::activeSubWindow ( )
protected

Return the currently active sub-window's MainWindowBase.

Returns
Pointer to the active sub-window's base, or nullptr

◆ closeSubWindows()

virtual void MdiWindow::closeSubWindows ( int  type)
protectedvirtual

Close all open sub-windows of the given type.

Parameters
typeApplication-defined sub-window type integer

◆ findFirstMdiSubWindow()

MdiSubWindow * MdiWindow::findFirstMdiSubWindow ( int  type) const
protected

Return the first open sub-window of the given type.

Parameters
typeApplication-defined sub-window type integer
Returns
Pointer to the first matching MdiSubWindow, or nullptr

◆ findMdiSubWindows()

QList< MdiSubWindow * > MdiWindow::findMdiSubWindows ( int  type) const
protected

Return all open sub-windows of the given type.

Parameters
typeApplication-defined sub-window type integer
Returns
List of matching MdiSubWindow pointers

◆ mdiArea()

QMdiArea * MdiWindow::mdiArea ( )
protected

Return the embedded QMdiArea.

Returns
Pointer to the QMdiArea

◆ openSubWindow()

virtual MdiSubWindow * MdiWindow::openSubWindow ( MainWindowBase window,
int  type 
)
protectedvirtual

Open a new MdiSubWindow wrapping the given MainWindowBase.

Parameters
windowContent window to host
typeApplication-defined sub-window type integer
Returns
Pointer to the created MdiSubWindow

◆ subWindowClosing()

virtual void MdiWindow::subWindowClosing ( MdiSubWindow window)
inlineprotectedvirtual

Called just before a sub-window closes (no-op by default).

Parameters
windowThe sub-window that is closing

Definition at line 72 of file mdiwindow.h.


The documentation for this class was generated from the following file: