DockMainWindow Class

The main window of an application that has a mechanism of dock panels and toolbars. It has a customized dock manager and all the necessary functions for adding dockable panels and bars. By analogy with QMainWindow it has a references to the QMenuBar and to QStatusBar. More...

Header: #include <DockMainWindow>
Inherits: QWidget

Public Functions

DockMainWindow(QWidget *parent = Q_NULL, Qt::WindowFlags flags = Qt::WindowFlags())
DockWidgetPanel *addDockPanel(const QString &title, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)
DockWidgetPanel *addDockPanel(const QString &title, const QSize &sizeHint, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)
DockWindow *addDockWindow(DockPanelBase *panel, const QRect &rect)
DockDocumentPanel *addDocumentPanel(const QString &title = QString())
DockToolBar *addToolBar(const QString &name, Qtitan::DockBarArea position)
QWidget *centralWidget() const
void clearDockBars()
void clearDockPanels()
DockBarManager *dockBarManager() const
const QList<DockBarBase *> &dockBars() const
DockPanelManager *dockPanelManager() const
bool insertDockBar(DockToolBar *bar, Qtitan::DockBarArea position)
void insertDockBar(DockToolBar *before, DockToolBar *bar)
void insertDockPanel(DockWidgetPanel *panel, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)
void insertDockPanel(DockWidgetPanel *panel, const QSize &sizeHint, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)
void insertDocumentPanel(DockDocumentPanel *documentPanel)
bool loadStateFromDevice(QIODevice *deviceBars, QIODevice *devicePanels)
QMenuBar *menuBar() const
void moveDockBar(DockToolBar *before, DockToolBar *bar)
void removeDockBar(DockToolBar *bar)
void removeDockPanel(DockWidgetPanel *panel)
void saveStateToDevice(QIODevice *deviceBars, QIODevice *devicePanels)
void setCentralWidget(QWidget *widget)
void setMenuBar(QMenuBar *bar)
void setStatusBar(QStatusBar *statusbar)
void setTitleBarWidget(QWidget *widget)
QStatusBar *statusBar() const
WindowTitleBar *titleBar() const
QWidget *titleBarWidget() const

Reimplemented Protected Functions

virtual bool event(QEvent *event) override
virtual void showEvent(QShowEvent *event) override

Detailed Description

See also DockPanelManager.

Member Function Documentation

[explicit] DockMainWindow::DockMainWindow(QWidget *parent = Q_NULL, Qt::WindowFlags flags = Qt::WindowFlags())

Constructor of the class DockMainWindow. Parameter the parent by default is NULL and flags by default is Qt::WindowFlags().

DockWidgetPanel *DockMainWindow::addDockPanel(const QString &title, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::addDockPanel(const QString& title, DockPanelArea area, DockPanelBase* before) description for the details.

DockWidgetPanel *DockMainWindow::addDockPanel(const QString &title, const QSize &sizeHint, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::addDockPanel(const QString& title, const QSize& sizeHint, DockPanelArea area, DockPanelBase* before) description for the details.

DockWindow *DockMainWindow::addDockWindow(DockPanelBase *panel, const QRect &rect)

Forwards the call to DockPanelManager::addDockWindow() that manages the main window.

See also DockPanelManager::addDockWindow().

DockDocumentPanel *DockMainWindow::addDocumentPanel(const QString &title = QString())

Forwards the call to DockPanelManager::addDocumentPanel() that manages the main window.

See also DockPanelManager::addDocumentPanel().

DockToolBar *DockMainWindow::addToolBar(const QString &name, Qtitan::DockBarArea position)

Forwards the call to DockBarManager that manages the main window. See DockBarManager::addToolBar(const QString& name, DockBarArea position) description for the details.

QWidget *DockMainWindow::centralWidget() const

Returns the central widget for the main window. This function returns zero if the central widget has not been set.

See also setCentralWidget().

void DockMainWindow::clearDockBars()

Forwards the call to DockBarManager::clearDockBars() that manages the main window.

See also DockBarManager::clearDockBars().

void DockMainWindow::clearDockPanels()

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::clearDockPanels() description for the details.

DockBarManager *DockMainWindow::dockBarManager() const

Returns DockBarManager that manages the main window.

const QList<DockBarBase *> &DockMainWindow::dockBars() const

Forwards the call to DockBarManager that manages the main window. See DockBarManager::dockBars() description for the details.

DockPanelManager *DockMainWindow::dockPanelManager() const

Returns DockPanelManager that manages the main window.

[override virtual protected] bool DockMainWindow::event(QEvent *event)

Reimplements: QWidget::event(QEvent *event).

bool DockMainWindow::insertDockBar(DockToolBar *bar, Qtitan::DockBarArea position)

Forwards the call to DockBarManager that manages the main window. See DockBarManager::insertDockBar(DockBarBase* bar, DockBarArea position) description for the details.

void DockMainWindow::insertDockBar(DockToolBar *before, DockToolBar *bar)

Forwards the call to DockBarManager that manages the main window. See DockBarManager::insertDockBar(DockToolBar* before, DockToolBar* bar) description for the details.

void DockMainWindow::insertDockPanel(DockWidgetPanel *panel, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::insertDockPanel(DockWidgetPanel* panel, DockPanelArea area, DockPanelBase* before) description for the details.

void DockMainWindow::insertDockPanel(DockWidgetPanel *panel, const QSize &sizeHint, Qtitan::DockPanelArea area, DockPanelBase *targetPanel = Q_NULL)

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::insertDockPanel(DockWidgetPanel* panel, const QSize& sizeHint, DockPanelArea area, DockPanelBase* before) description for the details.

void DockMainWindow::insertDocumentPanel(DockDocumentPanel *documentPanel)

Forwards the call to DockPanelManager::insertDocumentPanel() that manages the main window.

See also DockPanelManager::insertDocumentPanel().

bool DockMainWindow::loadStateFromDevice(QIODevice *deviceBars, QIODevice *devicePanels)

Restores the dock panels and bars state from the device.

Returns the menu bar for the main window.This function creates and returns an empty menu bar if the menu bar does not exist.

See also setMenuBar().

void DockMainWindow::moveDockBar(DockToolBar *before, DockToolBar *bar)

Forwards the call to DockBarManager that manages the main window. See DockBarManager:::moveDockBar(DockToolBar* before, DockToolBar* bar) description for the details.

void DockMainWindow::removeDockBar(DockToolBar *bar)

Forwards the call to DockBarManager that manages the main window. See DockBarManager::removeDockBar(DockBarBase* bar) description for the details.

void DockMainWindow::removeDockPanel(DockWidgetPanel *panel)

Forwards the call to DockPanelManager that manages the main window. See DockPanelManager::removeDockPanel(DockWidgetPanel* panel) description for the details.

void DockMainWindow::saveStateToDevice(QIODevice *deviceBars, QIODevice *devicePanels)

Saves the dock panels and bars state to the device.

void DockMainWindow::setCentralWidget(QWidget *widget)

Sets the given widget to be the main window's central widget.

Note: DockMainWindow takes ownership of the widget pointer and deletes it at the appropriate time.

See also centralWidget().

void DockMainWindow::setMenuBar(QMenuBar *bar)

Sets the menu bar for the main window to menuBar.

Note: DockMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time.

See also menuBar().

void DockMainWindow::setStatusBar(QStatusBar *statusbar)

Sets the status bar for the main window to statusbar. Setting the status bar to 0 will remove it from the main window.

Note: DockMainWindow takes ownership of the statusbar pointer and deletes it at the appropriate time.

See also statusBar().

void DockMainWindow::setTitleBarWidget(QWidget *widget)

Sets QWidget widget to the title bar. It is equals to titleBar()->setWidget(widget)

See also titleBarWidget().

[override virtual protected] void DockMainWindow::showEvent(QShowEvent *event)

Reimplements: QWidget::showEvent(QShowEvent *event).

QStatusBar *DockMainWindow::statusBar() const

Returns the status bar for the main window. This function creates and returns an empty status bar QStatusBar if the status bar does not exist.

See also setStatusBar().

WindowTitleBar *DockMainWindow::titleBar() const

Returns title bar for the main window.

QWidget *DockMainWindow::titleBarWidget() const

Returns QWidget embeded to the title bar. It is equals titleBar()->widget()

See also setTitleBarWidget().