QMainWindow subclass providing logging, status bar helpers, and geometry persistence.
More...
#include <mainwindowbase.h>
|
| 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.
|
| |
|
| | 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.
|
| |
| StatusBar * | statusBar () |
| | 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.
|
| |
|
|
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.
|
| |
QMainWindow subclass providing logging, status bar helpers, and geometry persistence.
MainWindowBase wires a StatusBar, persists window position/size across sessions, and exposes slots for showing plain or animated status messages. Call initializeBase() from the subclass constructor after building the UI.
Definition at line 30 of file mainwindowbase.h.
◆ MainWindowBase()
| MainWindowBase::MainWindowBase |
( |
const QString & |
loggingCategory, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
|
explicit |
Construct with a logging category and optional parent.
- Parameters
-
| loggingCategory | Category name used for log output |
| parent | Optional QWidget parent |
◆ defaultSize()
| QSize MainWindowBase::defaultSize |
( |
| ) |
const |
|
inline |
Return the default window size.
- Returns
- Default QSize
Definition at line 82 of file mainwindowbase.h.
◆ formLoadComplete()
| bool MainWindowBase::formLoadComplete |
( |
| ) |
const |
|
inline |
Return whether the form has finished loading.
- Returns
- true if form load is complete
Definition at line 140 of file mainwindowbase.h.
◆ formLoadFailed()
| bool MainWindowBase::formLoadFailed |
( |
| ) |
const |
|
inline |
Return whether the form failed to load.
- Returns
- true if form load failed
Definition at line 146 of file mainwindowbase.h.
◆ parentMdiArea()
| QMdiArea * MainWindowBase::parentMdiArea |
( |
| ) |
|
Return the parent QMdiArea if this window is hosted in one.
- Returns
- Pointer to the parent MdiArea, or nullptr
◆ persistPosition()
| bool MainWindowBase::persistPosition |
( |
| ) |
const |
|
inline |
Return whether the window persists its position between sessions.
- Returns
- true if position persistence is enabled
Definition at line 46 of file mainwindowbase.h.
◆ persistSize()
| bool MainWindowBase::persistSize |
( |
| ) |
const |
|
inline |
Return whether the window persists its size between sessions.
- Returns
- true if size persistence is enabled
Definition at line 58 of file mainwindowbase.h.
◆ setDefaultSize() [1/2]
| void MainWindowBase::setDefaultSize |
( |
const QSize & |
value | ) |
|
|
inline |
◆ setDefaultSize() [2/2]
| void MainWindowBase::setDefaultSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
Set the default window size by width and height.
- Parameters
-
| width | Default width in pixels |
| height | Default height in pixels |
Definition at line 95 of file mainwindowbase.h.
◆ setFormLoadComplete()
| void MainWindowBase::setFormLoadComplete |
( |
bool |
value | ) |
|
|
inlineprotected |
Set the form load completion flag.
- Parameters
-
| value | true when form load is complete |
Definition at line 156 of file mainwindowbase.h.
◆ setFormLoadFailed()
| void MainWindowBase::setFormLoadFailed |
( |
bool |
value | ) |
|
|
inlineprotected |
Set the form load failure flag.
- Parameters
-
| value | true if form load failed |
Definition at line 162 of file mainwindowbase.h.
◆ setPersistPosition()
| void MainWindowBase::setPersistPosition |
( |
bool |
value | ) |
|
|
inline |
Enable or disable position persistence.
- Parameters
-
| value | true to persist position |
Definition at line 52 of file mainwindowbase.h.
◆ setPersistSize()
| void MainWindowBase::setPersistSize |
( |
bool |
value | ) |
|
|
inline |
Enable or disable size persistence.
- Parameters
-
| value | true to persist size |
Definition at line 64 of file mainwindowbase.h.
◆ setType()
| void MainWindowBase::setType |
( |
int |
value | ) |
|
|
inline |
Set the application-defined window type integer.
- Parameters
-
Definition at line 76 of file mainwindowbase.h.
◆ showStatusBarAnimatedProgressMessage
| void MainWindowBase::showStatusBarAnimatedProgressMessage |
( |
const QString & |
text, |
|
|
const QColor & |
textColor = QColor() |
|
) |
| |
|
slot |
Show an animated progress message in the status bar.
- Parameters
-
| text | Message text (dots are appended periodically) |
| textColor | Foreground colour (default: palette default) |
◆ showStatusBarMessage [1/2]
| void MainWindowBase::showStatusBarMessage |
( |
const QString & |
text, |
|
|
const QColor & |
textColor, |
|
|
const TimeSpan & |
timeout = TimeSpan() |
|
) |
| |
|
slot |
Show a coloured status message with an optional timeout.
- Parameters
-
| text | Message text |
| textColor | Foreground colour for the message |
| timeout | Duration before the message is cleared (default: no timeout) |
◆ showStatusBarMessage [2/2]
| void MainWindowBase::showStatusBarMessage |
( |
const QString & |
text, |
|
|
const TimeSpan & |
timeout = TimeSpan() |
|
) |
| |
|
slot |
Show a default-coloured status message with an optional timeout.
- Parameters
-
| text | Message text |
| timeout | Duration before the message is cleared (default: no timeout) |
◆ statusBar()
◆ type()
| int MainWindowBase::type |
( |
| ) |
const |
|
inline |
Return the application-defined window type integer.
- Returns
- Window type value
Definition at line 70 of file mainwindowbase.h.
The documentation for this class was generated from the following file: