Dock Area Module

class pyqtgraph.dockarea.DockArea(parent=None, temporary=False, home=None)[source]
addContainer(typ, obj)[source]

Add a new container around obj

addDock(dock=None, position='bottom', relativeTo=None, **kwds)[source]

Adds a dock to this area.

dock The new Dock object to add. If None, then a new Dock will be created.
position ‘bottom’, ‘top’, ‘left’, ‘right’, ‘above’, or ‘below’
relativeTo If relativeTo is None, then the new Dock is added to fill an entire edge of the window. If relativeTo is another Dock, then the new Dock is placed adjacent to it (or in a tabbed configuration for ‘above’ and ‘below’).

All extra keyword arguments are passed to Dock.__init__() if dock is None.


Removes dock from this DockArea and places it in a new window.

moveDock(dock, position, neighbor)[source]

Move an existing Dock to a new location.

restoreState(state, missing='error', extra='bottom')[source]

Restore Dock configuration as generated by saveState.

This function does not create any Docks–it will only restore the arrangement of an existing set of Docks.

By default, docks that are described in state but do not exist in the dock area will cause an exception to be raised. This behavior can be changed by setting missing to ‘ignore’ or ‘create’.

Extra docks that are in the dockarea but that are not mentioned in state will be added to the bottom of the dockarea, unless otherwise specified by the extra argument.


Return a serialized (storable) representation of the state of all Docks in this DockArea.

class pyqtgraph.dockarea.Dock(name, area=None, size=(10, 10), widget=None, hideTitle=False, autoOrientation=True, closable=False)[source]
addWidget(widget, row=None, col=0, rowspan=1, colspan=1)[source]

Add a new widget to the interior of this Dock. Each Dock uses a QGridLayout to arrange widgets within.


Remove this dock from the DockArea it lives inside.


Hide the title bar for this Dock. This will prevent the Dock being moved by the user.


If this Dock is stacked underneath others, raise it to the top.

setOrientation(o='auto', force=False)[source]

Sets the orientation of the title bar for this Dock. Must be one of ‘auto’, ‘horizontal’, or ‘vertical’. By default (‘auto’), the orientation is determined based on the aspect ratio of the Dock.

setStretch(x=None, y=None)[source]

Set the ‘target’ size for this Dock. The actual size will be determined by comparing this Dock’s stretch value to the rest of the docks it shares space with.


Sets the text displayed in title bar for this Dock.


Show the title bar for this Dock.


Gets the text displayed in the title bar for this dock.