NavigationMainWindow Class

NavigationMainWindow provides main window with the navigation bar inherited from QWidget. Unlike NavigationMainWindowQt, it allows you to manage the placement of the navigation bar on the window. It is possible to arrange the bar on the left, right, bottom or top (by default). More...

Header: #include <NavigationMainWindow>
Inherits: QWidget

Public Functions

NavigationMainWindow(QWidget *parent = Q_NULL, Qt::WindowFlags flags = Qt::WindowFlags())
QWidget *centralWidget() const
QMenuBar *menuBar() const
QWidget *menuWidget() const
NavigationBar *navigationBar() const
Qtitan::LayoutArea navigationBarArea() const
void setCentralWidget(QWidget *widget)
void setMenuBar(QMenuBar *menubar)
void setMenuWidget(QWidget *menubar)
void setNavigationBar(NavigationBar *navigationBar)
void setNavigationBarArea(Qtitan::LayoutArea area)
void setStatusBar(QStatusBar *statusbar)
QStatusBar *statusBar() const
WindowTitleBar *titleBar() const

Reimplemented Protected Functions

virtual bool event(QEvent *event) override
virtual void paintEvent(QPaintEvent *event) override

Detailed Description

Example demonstrates a simple Qt application with Navigation UI.

#include <QApplication>
#include <QLabel>
#include <DevMachines/QtitanNavigationDesignUI>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    NavigationMainWindow window;
    window.setWindowTitle("Navigation UI");
    window.resize(550, 400);

    window.navigationBar()->addLogoButton(QIcon(":res/logo.png"));

    NavigationBackstageMenu* salesMenu = new NavigationBackstageMenu(window.navigationBar());
    salesMenu->addAction("Account", QIcon(":res/icon_32x32.png"), "Orders", WindowsColor(MetroUI_Teal));
    salesMenu->addAction("Account", QIcon(":res/icon_32x32.png"), "Licenses");

    NavigationMainMenu* mainMenu = new NavigationMainMenu(window.navigationBar());
    mainMenu->addAction(QIcon(":res/icon_85x71.png"), "Sales", WindowsColor(MetroUI_Chocolate), salesMenu);
    window.navigationBar()->addMainMenuButton(mainMenu);

    NavigationSidePane* sidePane = new NavigationSidePane(window.navigationBar());
    QLabel* helpText = new QLabel();
    helpText->setText("Help Text");
    sidePane->setWidget(helpText);
    window.navigationBar()->addHelpButton(sidePane);

    window.show();
    return app.exec();
}

Member Function Documentation

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

QWidget *NavigationMainWindow::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().

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

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

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().

Returns the menu bar for the main window. This function returns null if a menu bar hasn't been constructed yet.

See also setMenuWidget().

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

See also setNavigationBar().

Returns the navigation bar layout area on the window.

See also setNavigationBarArea().

[override virtual protected] void NavigationMainWindow::paintEvent(QPaintEvent *event)

Reimplements: QWidget::paintEvent(QPaintEvent *event).

void NavigationMainWindow::setCentralWidget(QWidget *widget)

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

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

See also centralWidget().

void NavigationMainWindow::setMenuBar(QMenuBar *menubar)

Sets the menu bar for the main window to menuBar.

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

See also menuBar().

void NavigationMainWindow::setMenuWidget(QWidget *menubar)

Sets the menu bar for the main window to menuBar.

NavigationMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time.

See also menuWidget().

void NavigationMainWindow::setNavigationBar(NavigationBar *navigationBar)

Sets the navigation bar for the main window to navigationBar. NavigationMainWindow takes ownership of the navigationBar pointer and deletes it at the appropriate time.

See also navigationBar().

void NavigationMainWindow::setNavigationBarArea(Qtitan::LayoutArea area)

Sets the navigation bar layout area on the window. By default it is Qtitan::TopArea

See also navigationBarArea().

void NavigationMainWindow::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: NavigationMainWindow takes ownership of the statusbar pointer and deletes it at the appropriate time.

See also statusBar().

QStatusBar *NavigationMainWindow::statusBar() const

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

See also setStatusBar() and NavigationStatusBar.

WindowTitleBar *NavigationMainWindow::titleBar() const

Returns title bar for the main window.