class KDockMainWindow

A special kind of KTMainWindow that is able to have dockwidget child widgets. More...

Definition#include <kdockwidget.h>
InheritsKTMainWindow
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Types

Protected Methods

Protected Slots

Protected Members


Detailed Description

A special kind of KTMainWindow that is able to have dockwidget child widgets.

The main widget should be a dockwidget where other dockwidgets can be docked to the left, right, top, bottom or to the middle. Furthermore, the KDockMainWindow has got the KDocManager and some data about the dock states.

 KDockMainWindow ( const char *name = 0L )

Constructs a dockmainwindow. It calls it base class constructor and does additional things concerning to the dock stuff: <UL><LI>information about the dock state of this' children gets initialized</LI> <LI>a dockmanager is created...</LI> <LI>...and gets initialized</LI> <LI>the main dockwidget is set to 0L</LI></UL>

Parameters:
nameobject name

KDockMainWindow ()

[virtual]

Destructs a dockmainwindow.

KDockManager*  manager ()

Returns the dockmanager of this. (@see KDockManager)

Returns: pointer to the wanted dockmanager

void  setMainDockWidget ( KDockWidget* )

Sets a new main dockwidget. Additionally, the toolbar is re-initialized.

Parameters:
_dockwidget that become the new main dockwidget

KDockWidget*  getMainDockWidget ()

Returns the main dockwidget.

Returns: pointer to the main dockwidget

KDockWidget*  createDockWidget ( const QString& name, const QPixmap &pixmap, QWidget* parent = 0L )

This is one of the most important methods! The KDockMainWindow creates a new dockwidget object here that usually should encapsulate the user's widget. The new dockwidget is automatically taken under control by the dockmanager of the dockmainwindow.

Parameters:
namedockwidget caption (window title)
pixmapwindow icon (for instance shown when docked as tabwidget entry)
parentparent widget for the new dockwidget

Returns: a pointer to the new created dockwidget

void  writeDockConfig ( KConfig* c = 0L, QString group = QString::null )

It writes the current dock state in the given section of KConfig.

Parameters:
cKDE class for saving configurations
groupname of section to write to

void  readDockConfig ( KConfig* c = 0L, QString group = QString::null )

It reads the current dock state from the given section of KConfig.

Parameters:
cKDE class for saving configurations
groupname of section to read from

void  activateDock ()

It runs through all dockwidgets which are under control of the dockmanager and calls show() for every encapsulated widget and show() for the dockwidget itself if it is not in tab mode. Additionally, if the main dockwidget is not a QDialog, it will be shown.

QPopupMenu*  dockHideShowMenu ()

Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.

Returns: the wanted popup menu

void  makeDockVisible ( KDockWidget* dock )

This method shows the given dockwidget. The clue is that it also considers the dockwidget could be a tab page and must set to be the activate one.

Parameters:
dockthe dockwidget that is to be shown

void  makeWidgetDockVisible ( QWidget* widget )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void  setView ( QWidget* )

This method calls the base class method. If the given widget inherits KDockWidget, applyToWidget(this) is called.

@param - any widget that should become the main view

Reimplemented from KTMainWindow

void  slotDockChange ()

[protected slot]

Updates the dock-toolbar buttons and the internal information about the 4 dockwidgets that are directly docked to the main widget.

void  slotToggled ( int )

[protected slot]

Inverts the state of the appropriate toggle-toolbutton of the dock-toolbar.

Parameters:
_index of the toolbutton

void  slotReplaceDock ( KDockWidget* oldDock, KDockWidget* newDock )

[protected slot]

Using the given parameters it updates the information about the 4 dockwidgets that are directly docked to the main widget.

Parameters:
oldDocknew main dockwidget
newDockold main dockwidget

DockPosData (struct)

[protected]

Used as container for information about one of the 4 dockwidgets that are directly docked to the main dockwidget.

void  toolBarManager ( bool toggled, DockPosData &data )

[protected]

This method docks as given in the position data, if toggled is true. Otherwise the dockwidget given with the position data will be undocked.

Parameters:
toggledspecifies if the dockwidget gets docked or undocked
datareference to the struct containing information about the appropriate dockwidget

KDockWidget* mainDockWidget

[protected]

A pointer to the main dockwidget (where one can manualDock() to

KDockManager* dockManager

[protected]

A pointer to the manager for the dock process

DockPosData DockL

[protected]

Contains information about which dockwidget is docked on the left.

DockPosData DockR

[protected]

Contains information about which dockwidget is docked on the right.

DockPosData DockT

[protected]

Contains information about which dockwidget is docked at the top.

DockPosData DockB

[protected]

Contains information about which dockwidget is docked at the bottom.

KToolBar* toolbar

[protected]

A pointer to the dock toolbar (for showing or hiding the 4 docked dockwidgets that are docked to the main dockwidget).