11#ifndef MAINWINDOWBASE_H
12#define MAINWINDOWBASE_H
16#include <Kanoop/utility/loggingbaseclass.h>
17#include <Kanoop/gui/libkanoopgui.h>
18#include <Kanoop/timespan.h>
19#include <Kanoop/gui/widgets/statusbar.h>
31 public LoggingBaseClass
40 explicit MainWindowBase(
const QString& loggingCategory, QWidget *parent =
nullptr);
70 int type()
const {
return _type; }
76 void setType(
int value) { _type = value; }
95 void setDefaultSize(
int width,
int height) { _defaultSize = QSize(width, height); }
173 bool _formLoadComplete =
false;
174 bool _formLoadFailed =
false;
175 bool _persistPosition =
true;
176 bool _persistSize =
true;
188 void onSpliltterMoved();
QMainWindow subclass providing logging, status bar helpers, and geometry persistence.
void setType(int value)
Set the application-defined window type integer.
void setFormLoadComplete(bool value)
Set the form load completion flag.
void setDefaultSize(const QSize &value)
Set the default window size.
void setPersistSize(bool value)
Enable or disable size persistence.
void showStatusBarAnimatedProgressMessage(const QString &text, const QColor &textColor=QColor())
Show an animated progress message in the status bar.
bool persistSize() const
Return whether the window persists its size between sessions.
virtual void moveEvent(QMoveEvent *event) override
Persist position on move.
StatusBar * statusBar()
Return the built-in StatusBar widget.
QSize defaultSize() const
Return the default window size.
void setFormLoadFailed(bool value)
Set the form load failure flag.
void stopStatusBarAnimation()
Stop any active status bar animation.
bool persistPosition() const
Return whether the window persists its position between sessions.
void showStatusBarMessage(const QString &text, const TimeSpan &timeout=TimeSpan())
Show a default-coloured status message with an optional timeout.
bool formLoadFailed() const
Return whether the form failed to load.
int type() const
Return the application-defined window type integer.
void initializeBase()
Perform base-class initialization; call from the subclass constructor.
QMdiArea * parentMdiArea()
Return the parent QMdiArea if this window is hosted in one.
virtual void showEvent(QShowEvent *event) override
Restore geometry and complete form load on first show.
bool formLoadComplete() const
Return whether the form has finished loading.
virtual void resizeEvent(QResizeEvent *event) override
Persist size on resize.
void setDefaultSize(int width, int height)
Set the default window size by width and height.
void showStatusBarMessage(const QString &text, const QColor &textColor, const TimeSpan &timeout=TimeSpan())
Show a coloured status message with an optional timeout.
MainWindowBase(const QString &loggingCategory, QWidget *parent=nullptr)
Construct with a logging category and optional parent.
virtual void onPreferencesChanged()
Called when application preferences change; override to react.
void setPersistPosition(bool value)
Enable or disable position persistence.
QStatusBar subclass with timed messages, color styling, and animated progress text.