class EXPORT_DOCKCLASS

A special kind of KMainWindow that is able to have dockwidget child widgets (and member of the dockwidget class set). More...

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

Public Types

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots

Protected Members


Detailed Description

A special kind of KMainWindow that is able to have dockwidget child widgets (and member of the dockwidget class set).

The main widget should be a KDockWidget where other KDockWidget can be docked to the left, right, top, bottom or to the middle. Note: dock to the middle means to drop on a dockwidget and to unite them to a new widget, a tab control. That tab widget is a KDockTabCtl .

Furthermore, the KDockMainWindow has got the KDocManager and some data about the dock states.

If you've got some dockwidgets, you can dock them to the dockmainwindow to initialize a start scene: Here an example:


 DockApplication::DockApplication( const char* name) : KDockMainWindow( name)
 {
   ...
   KDockWidget* mainDock;
   mainDock = createDockWidget( "Falk's MainDockWidget", mainPixmap);
   AnyContentsWidget* cw = new AnyContentsWidget( mainDock);
   mainDock->setWidget( cw);
   setView( mainDock);
   setMainDockWidget( mainDock);
   ...
   KDockWidget* dockLeft;
   dockLeft = createDockWidget( "Intially left one", anyOtherPixmap, 0L, i18n("The left dockwidget"));
   AnotherWidget* aw = new AnotherWidget( dockLeft);
   dockLeft->setWidget( aw);
   dockLeft->manualDock( mainDock,              // dock target
                         KDockWidget::DockLeft, // dock site
                         20 );                  // relation target/this (in percent)
   ...

Docking is fully dynamical at runtime. That means you can always move dockwidgets via drag and drop.

And last but not least you can use the popupmenu for showing or hiding any controlled dockwidget of this class and insert it to your main menu bar or anywhere else.

 KDockTabBar ( QWidget * parent = 0, const char * name = 0 )

Constructs a tab bar widget. The parent and name argument are sent to the QWidget constructor.

KDockTabBar ()

Destructs this.

enum TabPos {TAB_TOP, TAB_RIGHT }

For clearer setting (or asking for) the current tab page position.

void  setTabPos ( TabPos tabpos)

Set the position to tabpos and repaints this.

Parameters:
tabposEither TAB_TOP or TAB_RIGHT, just where you want it to be

int  insertTab ( const QString &label, int id = -1, int index = -1 )

Insert a new empty tab page to the tab bar.

If id is not specified, the tab is simply added. Otherwise it's inserted at the specified position.

Parameters:
labelThe title in the tab page header.
idSuggest an identification number for access operations but it will be shifted to the next free value.
indexThe tab page position (default=-1 means append)

Returns: The new allocated id.

void  setPixmap ( int id, const QPixmap &pix )

Set an icon for the tab page with that id.

Parameters:
idThe identification number of that desired page.
pixThe new pixmap.

void  setToolTip ( int id, const QString &toolTipStr )

Set a tooltip for the tab page with that id.

Parameters:
idThe identification number of that desired page.
toolTipStrThe new tooltip.

void  setTextColor ( int id, const QColor &color )

Set the text colour for the tab page with that id.

Parameters:
idThe identification number of that desired page.
colorThe new text colour.

const QColor&  textColor ( int id )

Retrieve the text colour for the tab page with that id.

Parameters:
idthe identification number of that desired tab page

Returns: the current text colour of that tab page

void  removeTab ( int id)

Removes the tab page with that id.

Parameters:
idThe identification number of that desired page.

int  currentTab ()

Retrieve the current tab page.

Returns: The id of the tab page.

void  setCurrentTab ( int id, bool allowDisable = false )

Set the current tab page to the page with that id.

Parameters:
idThe identification number of that desired page.
allowDisableDisables the tab page.

void  setTabEnabled ( int id, bool e)

Enable or disable the tab page with that id.

bool  isTabEnabled ( int id)

Returns if the tab page with that id is enabled or disabled.

void  setTabCaption ( int id, const QString &caption )

Set the title of the tab page with that id.

Parameters:
idThe identification number of that desired page.
captionA string for the title.

QString  tabCaption ( int id )

Retrieve the title of the tab page with that id.

Parameters:
idthe identification number of that desired page

void  show ()

[virtual]

Calls QWidget::show() and showPage() for the current tab page, additionally.

void  setFont ( const QFont & )

[virtual]

Set the font of this.

void  showTabIcon ( bool )

Show or hide the icons for the tab pages in the header.

bool  isShowTabIcon ()

Returns if the icons for the tab pages are shown in the header.

void  tabSelected ( int id)

[signal]

Signals that a tab page with that id is selected.

Parameters:
idthe identification number of that desired page

void  rightButtonPress ( int id, QPoint )

[signal]

Signals that the right mouse buttons is pressed on the tab page with that @pid.

Parameters:
idThe identification number of that desired page.

void  leftClicked ()

[protected slot]

Does things that should be done if someone has clicked the left mouse button.

void  rightClicked ()

[protected slot]

Does things that should be done if someone has clicked the right mouse button.

void  paintEvent ( QPaintEvent* )

[protected virtual]

Handles paint events for this widgets Reimplemented from QWidget

void  resizeEvent ( QResizeEvent* )

[protected virtual]

Handles resize events for this widgets Reimplemented from QWidget

void  keyPressEvent ( QKeyEvent* )

[protected virtual]

Handles key press events for this widgets Reimplemented from QWidget

QString  tip ( const QPoint & p )

returns the tooltip string of the tab at this position

QRect  findBarRectByPos ( int x, int y)

returns the tab rectangle at this position

void  mousePressEvent ( QMouseEvent * )

[protected virtual]

Handles mouse press events for this widgets Reimplemented from QWidget

void  mouseReleaseEvent ( QMouseEvent * )

[protected virtual]

Handles mouse release events for this widgets Reimplemented from QWidget

void  resizeEvent ( QResizeEvent * )

[protected virtual]

Handles resize events for this widgets Reimplemented from QWidget

void  paintEvent ( QPaintEvent * )

[protected virtual]

Handles paint events for this widgets Reimplemented from QWidget

 KDockTabCtl ( QWidget *parent = 0, const char *name = 0 )

Constructs a dock-tab control object.

KDockTabCtl ()

Destructs this.

void  setTabPos ( KDockTabBar::TabPos )

[virtual]

Calls KDockTabBar::setTabPos of its embedded tab bar but does layout actions, additionally.

KDockTabBar::TabPos  getTabPos ()

Returns the current tab position of its docktabbar.

int  insertPage ( QWidget * w, const QString &label, int id = -1, int index = -1 )

Inserts a new tab page in the encapsulated docktabbar. Mainly it calls KDockTabBar::insertTab and does additional management operations.

Parameters:
wthe widget that is inserted
labelthe title for the caption bar of the tab page
idsuggest an identification number for access operations but it will be shifted to the next free value
indexthe tab page position (default=-1 means append)

Returns: the id of the new inserted page

void  setPageCaption ( QWidget* w, const QString &s )

Sets the title of the tab page. Mainly it calls KDockTabBar::setPageCaption but calls it internally by the page id.

Parameters:
wthe widget we want to give a new caption
swell, what the heck could that be? ;-)

void  setPageCaption ( int id, const QString &caption )

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

QString  pageCaption ( QWidget* w)

Returns the title of the tab page. Mainly it calls KDockTabBar::setPageCaption but calls it internally by the page id.

Parameters:
wthe widget for that we want to know its caption

Returns: a string containing the title of the page

QString  pageCaption ( int id )

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

void  setPixmap ( QWidget* w, const QPixmap &pix )

Sets an icon for the tab page (shown in the tab header).

Parameters:
wthe widget we want to give a new icon
pixthe new icon

void  setPixmap ( int id, const QPixmap &pix )

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

void  setToolTip ( QWidget* w, const QString &toolTipStr )

Sets a toolTip for the tab page (shown in the tab header).

Parameters:
wthe widget we want to give the tooltip
toolTipStrthe new tooltip string

void  setTabTextColor ( QWidget*, const QColor &color )

Sets the text colour of the tab page. Mainly it calls KDockTabBar::setTextColor but calls it internally by the page id.

Parameters:
wthe widget we want to give a new text colour
colorthe colour of the tab header

void  setTabTextColor ( int id, const QColor &color )

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

const QColor&  tabTextColor ( QWidget* w)

Returns the text colour of the tab page. Mainly it calls KDockTabBar::textColor but calls it internally by the page id.

Parameters:
wthe widget we want to ask for its text colour

const QColor&  tabTextColor ( int id )

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

bool  isPageEnabled ( QWidget* w)

Returns if the tab page is enabled (if it can get the focus).

Parameters:
wthe widget we want to ask if its page is enabled

bool  isPageEnabled ( int id )

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

void  setPageEnabled ( QWidget* w, bool e)

Enable or disable the tab page (whether it can get the focus or not). Mainly it calls KDockTabBar::setPageEnabled but calls it internally by the page id.

Parameters:
wthe widget that should be enabled
eboolean value whether enabled or disabled

void  setPageEnabled ( int id, bool enabled )

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

QWidget*  page ( int id)

/

/** Returns the widget that embedded in a page.

Parameters:
idthe identification number of the page

int  id ( QWidget* w)

Returns the widget's Id.

Parameters:
wthe widget that should return its id

int  index ( QWidget* w)

Returns the widget's index. (tab page position)

Parameters:
wthe widget that should return its index

void  removePage ( QWidget* w)

Removes the tab page from the covered tab bar. Mainly it calls KDockTabBar::removeTab but calls it internally by the page id.

Parameters:
wthe tab page that should be removed

void  removePage ( int id )

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

QWidget*  visiblePage ()

Returns the current (visible) tab page.

int  visiblePageId ()

Returns the id of the current (visible) tab page.

void  setVisiblePage ( QWidget*, bool allowDisable = false )

Sets the given tab page as the active (and visible) one.

void  setTabFont ( const QFont &font )

Sets the font for the tab pages. It just calls the appropriate method of its KDockTabBar.

QFont  tabFont ()

Returns the font for the tab pages. It simply calls KDockTabBar::tabFont .

void  showTabIcon ( bool )

Enables or disables the showing of the icons for every tab page. It simply calls KDockTabBar::showTabIcon .

bool  isShowTabIcon ()

Returns if the tab icon is shown. It simply calls KDockTabBar::isShowTabIcon .

int  pageCount ()

Returns the number of inserted tab pages.

QWidget*  getFirstPage ()

Returns the first tab page in its KDockTabBar.

QWidget*  getLastPage ()

Returns the last tab page in its KDockTabBar.

QWidget*  getNextPage ( QWidget* )

Returns the tab page that is at the right side of the given tab widget.

QWidget*  getPrevPage ( QWidget* )

Returns the tab page that is at the left side of the given tab widget.

void  show ()

[virtual]

Shows its encapsulated tab bar and shows the current tab page.

bool  eventFilter ( QObject*, QEvent* )

[virtual]

Catches some events that are of interest for this class.

void  setEnabled ( bool )

[virtual slot]

Enables or disables this and its KDockTabBar.

void  setVisiblePage (int id)

[slot]

Sets the visible page by its id.

void  paintEvent (QPaintEvent *)

[protected]

Handles paint events for this widgets Reimplemented from QWidget

void  aboutToShow ( QWidget* )

[signal]

Signals that the given widget is about to show.

void  pageSelected ( QWidget* )

[signal]

Signals that that tab page is selected.

void  tabShowPopup ( int, QPoint )

[signal]

Signals that the right mouse button is pressed on this.

void  rightButtonPress ( int, QPoint )

[protected slot]

Do some things that should be done when someone has pressed the right mouse button on this.

KDockTabCtl_PrivateStruct*  findData ( QWidget* )

[protected]

Returns the appropriate data for the widget from the parameter list.

KDockTabCtl_PrivateStruct*  findData ( int id )

[protected]

Returns the appropriate data for the widget from the parameter list described by its id.

void  showPage ( QWidget*, bool allowDisable = false )

[protected]

Shows the tab page.

QWidgetStack* stack

[protected]

a data structure that contains all embedded widgets.

QBoxLayout* layout

[protected]

The layout manager for automatic positioning and resizing of the embedded tab pages.

QBoxLayout* stack_layout

[protected]

The layout manager for the widget stack.

QList<KDockTabCtl_PrivateStruct> * mainData

[protected]

An internal list for managing the tab pages. It stores data items for every tab page in the tab bar. An data item is of type KDockTabCtl_PrivateStruct (a struct) that contains the widget, its id and information about whether it is enabled or disabled.

QWidget* currentPage

[protected]

A pointer to the widget that is the current tab page in the covered tab bar.

KDockTabBar* tabs

[protected]

The actual tab bar widget that is encapsulated by this control class. Often this manager puts only method calls through and does some additional management functions.

KDockTabBar::TabPos tabPos

[protected]

The current tab position.

 KDockTabGroup ( QWidget *parent = 0, const char *name = 0 ) :KDockTabCtl( parent, name )

Constructs this. It just calls the method of the base class.

KDockTabGroup ()

[virtual]

Destructs a KDockTabGroup.

 KDockWidget ( KDockManager* dockManager, const char* name, const QPixmap &pixmap, QWidget* parent = 0L, const QString& strCaption = 0L, const QString& strTabPageLabel = " ", WFlags f = 0)

Construct a dockwidget.

Initially, docking to another and docking to this is allowed for every DockPosition. It is supposed to be no (tab) group. It will taken under control of its dockmanager.

Parameters:
dockManagerThe responsible manager (dock helper)
nameObject instance name
pixmapAn icon (for instance shown when docked centered)
parentParent widget
strCaptionTitle of the dockwidget window (shown when toplevel)
strTabPageLabelThe title of the tab page (shown when in tab page mode), if it is "", only the icon will be shown, if it is 0L, the label is set to strCaption

KDockWidget ()

[virtual]

Destructs a dockwidget.

enum DockPosition {DockNone = 0, DockTop = 0x0001, DockLeft = 0x0002, DockRight = 0x0004, DockBottom = 0x0008, DockCenter = 0x0010, DockDesktop= 0x0020, DockCorner = DockTop | DockLeft | DockRight | DockBottom, DockFullSite = DockCorner | DockCenter, DockFullDocking = DockFullSite | DockDesktop }

The possible positions where a dockwidget can dock to another dockwidget

KDockWidget*  manualDock ( KDockWidget* target, DockPosition dockPos, int spliPos = 50, QPoint pos = QPoint(0,0), bool check = false, int tabIndex = -1)

This is a key method of this class! Use it to dock dockwidgets to another dockwidget at the right position within its KDockMainWindow or a toplevel dockwidget.

If the target is null, it will become a toplevel dockwidget at position pos; Note: Docking to another dockwidget means exactly: A new parent dockwidget will be created, that replaces the target dockwidget and contains another single helper widget (tab widget or panner) which contains both dockwidgets, this and the target dockwidget. So consider parent<->child relationships change completely during such actions.

Parameters:
targetThe dockwidget to dock to
dockPosOne of the DockPositions this is going to dock to
spliPosThe split relation (in percent) between both dockwidgets, target and this
posThe dock position, mainly of interest for docking to the desktop (as toplevel dockwidget)
checkOnly for internal use;
tabIndexThe position index of the tab widget (when in tab page mode), -1 (default) means append

Returns: result The group dockwidget that replaces the target dockwidget and will be grandparent of target and this.

void  setEnableDocking ( int pos )

Specify where it is either possible or impossible for this to dock to another dockwidget.

Parameters:
posAn OR'ed set of DockPositions

int  enableDocking ()

Returns: Where it is either possible or impossible for this to dock to another dockwidget (an OR'ed set of DockPositions).

void  setDockSite ( int pos )

Specify where it is either possible or impossible for another dockwidget to dock to this.

Parameters:
posAn OR'ed set of DockPositions

int  dockSite ()

Returns: There it is either possible or impossible for another dockwidget to dock to this (an OR'ed set of DockPositions).

void  setWidget ( QWidget* w)

Set the embedded widget.

A QLayout takes care about proper resizing, automatically.

Parameters:
wThe pointer to the dockwidget's child widget.

QWidget*  getWidget ()

Get the embedded widget.

Returns: The pointer to the dockwidget's child widget, 0L if there's no such child.

void  setHeader ( KDockWidgetAbstractHeader* ah)

Set the header of this dockwidget.

A QLayout takes care about proper resizing, automatically. The header contains the drag panel, the close button and the stay button.

Parameters:
ahA base class pointer to the dockwidget header

void  makeDockVisible ()

Normally it simply shows the dockwidget.

But additionally, if it is docked to a tab widget (DockCenter), it is set as the active (visible) tab page.

bool  mayBeHide ()

There are reasons that it's impossible:

Returns: If it may be possible to hide this.

bool  mayBeShow ()

Returns: If it may be possible to show this. There are reasons that it's impossible:

KDockManager*  dockManager ()

Returns: The dockmanager that is responsible for this.

void  setToolTipString (const QString& ttStr)

Stores a string for a tooltip.

That tooltip string has only a meaning when this dockwidget is shown as tab page. In this case the tooltip is shown when one holds the mouse cursor on the tab page header. Such tooltip will for instance be useful, if you use only icons there. Note: Setting an empty string switches the tooltip off.

Parameters:
ttStrA string for the tooltip on the tab.

const QString&  toolTipString ()

Returns: The tooltip string being shown on the appropriate tab page header when in dock-centered mode.

bool  isDockBackPossible ()

Returns: result true, if a dockback is possible, otherwise false.

void  setTabPageLabel ( const QString& label)

Set a string that is used for the label of the tab page when in tab page mode

Parameters:
labelThe new tab page label.

const QString&  tabPageLabel ()

Returns: A string that is used for the label of the tab page when in tab page mode.

bool  event ( QEvent * )

[virtual]

Catches and processes some QWidget events that are interesting for dockwidgets.

void  show ()

[virtual]

Add dockwidget management actions to QWidget::show.

KDockTabGroup*  parentDockTabGroup ()

Returns: the parent widget of this if it inherits class KDockTabGroup

void  dockBack ()

[slot]

Docks a dockwidget back to the dockwidget that was the neighbor widget before the current dock position.

void  changeHideShowState ()

[slot]

Toggles the visibility state of the dockwidget if it is able to be shown or to be hidden.

void  undock ()

[slot]

Undocks this. It means it becomes a toplevel widget framed by the system window manager. A small panel at the top of this undocked widget gives the possibility to drag it into another dockwidget by mouse (docking).

KDockTabGroup*  parentTabGroup ()

[protected]

Returns: the parent widget of this if it inherits class KDockTabGroup Warning: This will be removed in KDE-3.0. Use parentDockTabGroup instead.

void  updateHeader ()

[protected]

Check some conditions and show or hide the dockwidget header (drag panel). The header is hidden if:

void  docking ( KDockWidget* dw, KDockWidget::DockPosition dp)

[signal]

Emits that another dockwidget is docking to this.

Parameters:
dwthe dockwidget that is docking to this
dpthe DockPosition where it wants to dock to

void  setDockDefaultPos ()

[signal]

Signals that the dock default position is set.

void  headerCloseButtonClicked ()

[signal]

Signals that the close button of the panel (KDockWidgetHeader) has been clicked.

void  headerDockbackButtonClicked ()

[signal]

Signals that the dockback button of the panel (KDockWidgetHeader) has been clicked.

void  iMBeingClosed ()

[signal]

Signals that the widget processes a close event.

void  hasUndocked ()

[signal]

Signals that the widget is undocked now.

void  loseFormerBrotherDockWidget ()

[protected slot]

Does several things here when it has noticed that the former brother widget (closest neighbor) gets lost. The former brother widget is needed for a possible dockback action, to speak with the Beatles: "To get back to where you once belonged" ;-)

KDockWidget* formerBrotherDockWidget

[protected]

earlier closest neighbor widget, so it's possible to dock back to it.

DockPosition currentDockPos

[protected]

the current dock position.

DockPosition formerDockPos

[protected]

the former dock position when it really was at another position before.

QString toolTipStr

[protected]

a string used as tooltip for the tab page header when in dock-centered mode.

QString tabPageTitle

[protected]

a string used as title of the tab page when in tab page mode

 KDockManager ( QWidget* mainWindow, const char* name = 0L )

Constructs a dockmanager. Some initialization happen:

Parameters:
mainWindowthe main window controlled by this
namethe internal QOject name

KDockManager ()

[virtual]

Destructs a dockmanager.

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

Saves the current state of the dockmanager and of all controlled widgets. State means here to save the geometry, visibility, parents, internal object names, orientation, separator positions, dockwidget-group information, tab widget states (if it is a tab group) and last but not least some necessary things for recovering the dockmainwindow state.

Parameters:
cthe KDE configuration saver
groupthe name of the section in KConfig

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

Like writeConfig but reads the whole stuff in.

In order to restore a window configuration from a config file, it looks up widgets by name (QObject::name) in the childDock variable of KDockManager. This list in turn contains all KDockWidgets (according to the KDockWidget constructor). So in principle, in order to restore a window layout, one must first construct all widgets, put each of them in a KDockWidget and then call readConfig(). And for all that to work, each widget must have a unique name.

Parameters:
cthe KDE configuration saver
groupthe name of the section in KConfig

void  writeConfig (QDomElement &base)

Saves the current dock window layout into a DOM tree below the given element.

void  readConfig (QDomElement &base)

Reads the current dock window layout from a DOM tree below the given element.

void  activate ()

Shows all encapsulated widgets of all controlled dockwidgets and shows all dockwidgets which are parent of a dockwidget tab group.

bool  eventFilter ( QObject *, QEvent * )

[virtual]

It's more or less a method that catches several events which are interesting for the dockmanager. Mainly mouse events during the drag process of a dockwidgets are of interest here.

Parameters:
_the object that sends the event
_the event

Returns: the return value of the method call of the base class method

KDockWidget*  findWidgetParentDock ( QWidget* w)

This method finds out what a widgets' dockwidget is. That means the dockmanager has a look at all dockwidgets it knows and tells you when one of those dockwidgets covers the given widget.

Parameters:
wany widget that is supposed to be encapsulated by one of the controlled dockwidgets

Returns: the dockwidget that encapsulates that widget, otherwise 0

void  makeWidgetDockVisible ( QWidget* w )

Works like makeDockVisible() but can be called for widgets that covered by a dockwidget.

Parameters:
wthe widget that is encapsulated by a dockwidget that turns to visible.

QPopupMenu*  dockHideShowMenu ()

Returns: the popupmenu for showing/hiding dockwidgets

KDockWidget*  getDockWidgetFromName ( const QString& dockName )

Parameters:
dockNamean internal QObject name

Returns: the dockwidget that has got that internal QObject name

void  change ()

[signal]

Signals changes of the docking state of a dockwidget. Usually the dock-toolbar will be updated then.

void  replaceDock ( KDockWidget* oldDock, KDockWidget* newDock )

[signal]

Signals a dockwidget is replaced with another one.

void  setDockDefaultPos ( KDockWidget* )

[signal]

Signals a dockwidget without parent (toplevel) is shown.

 KDockMainWindow ( QWidget* parent = 0L, const char *name = 0L, WFlags f = WType_TopLevel | WDestructiveClose )

Constructs a dockmainwindow. It calls its base class constructor and does additional things concerning to the dock stuff:

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, const QString& strCaption = 0L, const QString& strTabPageLabel = " ")

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:
nameQObject name (default dockwidget caption)
pixmapwindow icon (for instance shown when docked as tabwidget entry)
parentparent widget for the new dockwidget
strCaptionwindow title (shown when toplevel)
strTabPageLabeltitle of the tab page (visible when in tab page mode), if it is "", only the icon will be shown; if it is 0L, the label is set to strCaption

Returns: a pointer to the new created dockwidget

void  writeDockConfig (QDomElement &base)

Saves the current dock window layout into a DOM tree below the given element.

void  readDockConfig (QDomElement &base)

Reads the current dock window layout from a DOM tree below the given element.

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  makeDockInvisible ( KDockWidget* dock )

This method hides the given dockwidget.

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.

Parameters:
_any widget that should become the main view

void  dockWidgetHasUndocked (KDockWidget*)

[signal]

Signals a certain dockwidget is undocked now.

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

void  slotDockWidgetUndocked ()

[protected slot]

Called whenever one of the dockwidgets of this has been undocked.