KDockMainWindow Class Reference
#include <kdockwidget.h>
Inheritance diagram for KDockMainWindow:

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.
Furthermore, the KDockMainWindow has got the KDockManager 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, 0L, "main_dock_widget"); AnyContentsWidget* cw = new AnyContentsWidget( mainDock); mainDock->setWidget( cw); // allow others to dock to the 4 sides mainDock->setDockSite(KDockWidget::DockCorner); // forbit docking abilities of mainDock itself mainDock->setEnableDocking(KDockWidget::DockNone); setView( mainDock); // central widget in a KDE mainwindow setMainDockWidget( mainDock); // master dockwidget ... 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 dynamic 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.
- Author:
- Max Judin (documentation: Falk Brettschneider).
Definition at line 1307 of file kdockwidget.h.
Signals | |
void | dockWidgetHasUndocked (KDockWidget *) |
Public Member Functions | |
KDockMainWindow (QWidget *parent=0L, const char *name=0L, WFlags f=WType_TopLevel|WDestructiveClose) | |
virtual | ~KDockMainWindow () |
KDockManager * | manager () const |
void | setMainDockWidget (KDockWidget *dockwidget) |
KDockWidget * | getMainDockWidget () const |
KDockWidget * | createDockWidget (const QString &name, const QPixmap &pixmap, QWidget *parent=0L, const QString &strCaption=QString::null, const QString &strTabPageLabel=QString::fromLatin1(" ")) |
void | writeDockConfig (QDomElement &base) |
void | readDockConfig (QDomElement &base) |
void | writeDockConfig (KConfig *c=0L, QString group=QString::null) |
void | readDockConfig (KConfig *c=0L, QString group=QString::null) |
void | activateDock () |
QPopupMenu * | dockHideShowMenu () const |
void | makeDockVisible (KDockWidget *dock) |
void | makeDockInvisible (KDockWidget *dock) |
void | makeWidgetDockVisible (QWidget *widget) |
void | setView (QWidget *widget) |
Protected Slots | |
void | slotDockWidgetUndocked () |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KDockWidget * | mainDockWidget |
KDockManager * | dockManager |
Friends | |
class | KDockManager |
Constructor & Destructor Documentation
|
Constructs a dockmainwindow. It calls its base class constructor and does additional things concerning to the dock stuff:
Definition at line 102 of file kdockwidget.cpp. |
|
Destructs a dockmainwindow.
Definition at line 110 of file kdockwidget.cpp. |
Member Function Documentation
|
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. Definition at line 1402 of file kdockwidget.h. |
|
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.
Definition at line 135 of file kdockwidget.cpp. |
|
Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.
Definition at line 1410 of file kdockwidget.h. |
|
Signals a certain dockwidget is undocked now.
|
|
Returns the main dockwidget.
Definition at line 1353 of file kdockwidget.h. |
|
This method hides the given dockwidget.
Definition at line 146 of file kdockwidget.cpp. |
|
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.
Definition at line 140 of file kdockwidget.cpp. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Definition at line 152 of file kdockwidget.cpp. |
|
Returns the dockmanager of this. (see KDockManager)
Definition at line 1338 of file kdockwidget.h. |
|
It reads the current dock state from the given section of KConfig.
Definition at line 173 of file kdockwidget.cpp. |
|
Reads the current dock window layout from a DOM tree below the given element.
Definition at line 162 of file kdockwidget.cpp. |
|
Sets a new main dockwidget. Additionally, the toolbar is re-initialized.
Definition at line 115 of file kdockwidget.cpp. |
|
This method calls the base class method. If the given widget inherits KDockWidget, applyToWidget(this) is called.
Definition at line 122 of file kdockwidget.cpp. |
|
Called whenever one of the dockwidgets of this has been undocked.
Definition at line 179 of file kdockwidget.cpp. |
|
It writes the current dock state in the given section of KConfig.
Definition at line 168 of file kdockwidget.cpp. |
|
Saves the current dock window layout into a DOM tree below the given element.
Definition at line 157 of file kdockwidget.cpp. |
Member Data Documentation
|
A pointer to the manager for the dock process.
Definition at line 1458 of file kdockwidget.h. |
|
A pointer to the main dockwidget (where one can manualDock() to.
Definition at line 1453 of file kdockwidget.h. |
The documentation for this class was generated from the following files: