Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QMainWindow Class Reference

The QMainWindow class provides a main application window. More...

    #include <QMainWindow>

Inherits QWidget.

- List of all members, including inherited members
- Obsolete members

### Writable Properties

- 33 writable properties inherited from QWidget
- 1 writable property inherited from QObject

### Read-Only Properties

- 24 read-only properties inherited from QWidget

### Public Functions

- QMainWindow ( QWidget * parent = 0, Qt::WFlags flags = 0 )
- ~QMainWindow ()
- QWidget * centralWidget () const
- Qt::DockWindowArea corner ( Qt::Corner corner ) const
- QMenuBar * menuBar () const
- void setCentralWidget ( QWidget * widget )
- void setCorner ( Qt::Corner corner, Qt::DockWindowArea area )
- void setMenuBar ( QMenuBar * menubar )
- void setStatusBar ( QStatusBar * statusbar )
- QStatusBar * statusBar () const

- 83 public functions inherited from QWidget
- 24 public functions inherited from QObject
- 2 public functions inherited from QPaintDevice

### Public Slots

- 16 public slots inherited from QWidget
- 1 public slot inherited from QObject

### Signals

- 1 signal inherited from QObject

### Static Public Members

- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject

### Protected Functions

- 44 protected functions inherited from QWidget
- 9 protected functions inherited from QObject

## Detailed Description

The QMainWindow class provides a main application window.

QMainWindow provides a main application window, with a menu bar, tool bars, dock windows and a status bar around a large central widget, such as a text edit, drawing canvas or QWorkspace (for MDI applications).

See also QDockWindow and QToolBar.

## Member Function Documentation

### QMainWindow::QMainWindow ( QWidget * parent = 0, Qt::WFlags flags = 0 )

Constructs a QMainWindow with the given parent and the specified widget flags.

### QMainWindow::~QMainWindow ()

Destroys the main window.

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

### Qt::DockWindowArea QMainWindow::corner ( Qt::Corner corner ) const

Returns the dock window area that occupies the specified corner.

See also setCorner().

### QMenuBar * QMainWindow::menuBar () const

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 QMainWindow::setCentralWidget ( QWidget * widget )

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

Warning: This function should be called at most once for each main window instance

See also centralWidget().

### void QMainWindow::setCorner ( Qt::Corner corner, Qt::DockWindowArea area )

Sets the given dock window area to occupy the specified corner.

See also corner().

### void QMainWindow::setMenuBar ( QMenuBar * menubar )

Sets the menu bar for the main window to menubar.

See also menuBar().

### void QMainWindow::setStatusBar ( QStatusBar * statusbar )

Sets the status bar for the main window to statusbar.

See also statusBar().

### QStatusBar * QMainWindow::statusBar () const

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

See also setStatusBar().