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

# QDockWindow Class Reference

The QDockWindow class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop. More...

    #include <QDockWindow>

Inherits QFrame.

- List of all members, including inherited members

### Public Types

- enum DockWindowFeature { DockWindowClosable, DockWindowMovable, DockWindowFloatable, AllDockWindowFeatures, NoDockWindowFeatures }
- typedef DockWindowFeatures

### Writable Properties

- allowedAreas : Qt::DockWindowAreas
- area : Qt::DockWindowArea
- features : DockWindowFeatures

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

### Read-Only Properties

- 1 read-only property inherited from QFrame
- 24 read-only properties inherited from QWidget

### Public Functions

- QDockWindow ( QMainWindow * parent, Qt::WFlags flags = 0 )
- QDockWindow ( QMainWindow * parent, Qt::DockWindowArea area, Qt::WFlags flags = 0 )
- ~QDockWindow ()
- bool hasFeature ( DockWindowFeature feature ) const
- bool isDockable ( Qt::DockWindowArea area )
- QMainWindow * mainWindow () const
- void setFeature ( DockWindowFeature features, bool on = true )
- void setParent ( QMainWindow * parent )
- void setWidget ( QWidget * widget )
- QWidget * widget () const

- 2 public functions inherited from QFrame
- 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 QDockWindow class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop.

QDockWindow provides the concept of dock windows, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the dock window area around the center widget in a QMainWindow.

### mainwindow diagram showing the various areas of the mainwindow should go here - see below

Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked) by the end-user. The QDockWindow API allows the programmer to restrict the dock windows ability to move, float and close, as well as the areas in which they can be placed.

### Appearance

A QDockWindow consists of a title bar and the content area. The titlebar displays the dock windows window title, a float button and a close button. Depending on the state of the QDockWindow, the float and close buttons may be either disabled or not shown at all.

The visual appearance of the title bar and buttons is style dependent.

### screenshot of QDockWindow in a few styles should go here

### Behavior

- behaviour of QDockWindow while docked in QMainWindow:
- behaviour of QDockWindow while floated:
- behaviour while dragging QDockWindow:
  - to an unoccupied dock window area:
  - to an occupied dock window area:
  - to top-level:

See also QMainWindow.

## Member Type Documentation

### enum QDockWindow::DockWindowFeature
typedef QDockWindow::DockWindowFeatures

`QDockWindow::DockWindowClosable` | The dock window can be closed.
`QDockWindow::DockWindowMovable` | The dock window can be moved between docks by the user.
`QDockWindow::DockWindowFloatable` | The dock window can be detached from the main window, and floated as an independent window.
`QDockWindow::AllDockWindowFeatures` | The dock window can be closed, moved, and floated.
`QDockWindow::NoDockWindowFeatures` | The dock window cannot be closed, moved, or floated.

The DockWindowFeatures typedef can store a combination of DockWindowFeature values.

## Property Documentation

### allowedAreas : Qt::DockWindowAreas

This property holds areas where the dock window may be placed.

The default is `Qt::AllDockWindowAreas`.

Access functions:

- Qt::DockWindowAreas allowedAreas () const
- void setAllowedAreas ( Qt::DockWindowAreas areas )

See also QDockWindow::area.

### area : Qt::DockWindowArea

This property holds area where the dock window is current placed.

The default is `Qt::DockWindowAreaLeft`.

Access functions:

- Qt::DockWindowArea area () const
- void setArea ( Qt::DockWindowArea area )
- void setArea ( Qt::DockWindowArea area, Qt::Orientation direction, bool extend = false )
- void setArea ( QDockWindow * after, Qt::Orientation direction )

See also QDockWindow::allowedAreas.

### features : DockWindowFeatures

This property holds whether the dock window is movable, closable, and floatable.

Access functions:

- DockWindowFeatures features () const
- void setFeatures ( DockWindowFeatures features )

See also DockWindowFeature, setFeature(), and hasFeature().

## Member Function Documentation

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

Constructs a QDockWindow with parent parent and widget flags flags. The dock window will be placed in the left dock window area.

### QDockWindow::QDockWindow ( QMainWindow * parent, Qt::DockWindowArea area, Qt::WFlags flags = 0 )

Constructs a QDockWindow with parent parent, placed in area and with widget flags flags.

### QDockWindow::~QDockWindow ()

Destroys the dock window.

### bool QDockWindow::hasFeature ( DockWindowFeature feature ) const

### bool QDockWindow::isDockable ( Qt::DockWindowArea area )

Returns true if this dock window can be placed in the given area; otherwise returns false.

### QMainWindow * QDockWindow::mainWindow () const

Returns the main window for this dock window.

See also setParent().

### void QDockWindow::setFeature ( DockWindowFeature features, bool on = true )

### void QDockWindow::setParent ( QMainWindow * parent )

Sets the main window for this dock window to parent.

See also mainWindow().

### void QDockWindow::setWidget ( QWidget * widget )

Sets the widget for the dock window to widget.

See also widget().

### QWidget * QDockWindow::widget () const

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

See also setWidget().