|
|
A special kind of KTMainWindow 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( mainDock); setView( mainDock); setMainDockWidget( mainDock); ... KDockWidget* dockLeft; dockLeft = createDockWiget( "Intially left one", anyOtherPixmap, 0L, i18n("The left dockwidget")); AnotherWidget* aw( dockLeft); 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.
Additionally, you get a toolbar for showing and hiding the 4 main dockwidgets which are docked to the actual mainwidget (that is usually a dockwidget as well).
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.
|
Constructs a dockmainwindow. It calls its base class constructor and does additional things concerning to the dock stuff:
Parameters:
name | object name |
~ |
[virtual]
Destructs a dockmainwindow.
KDockManager* |
Returns the dockmanager of this. (see KDockManager)
Returns: pointer to the wanted dockmanager
void |
Sets a new main dockwidget. Additionally, the toolbar is re-initialized.
Parameters:
_ | dockwidget that become the new main dockwidget |
KDockWidget* |
Returns the main dockwidget.
Returns: pointer to the main dockwidget
KDockWidget* |
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:
name | QObject name (default dockwidget caption) |
pixmap | window icon (for instance shown when docked as tabwidget entry) |
parent | parent widget for the new dockwidget |
strCaption | window title (shown when toplevel) |
strTabPageLabel | title 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 |
It writes the current dock state in the given section of KConfig.
Parameters:
c | KDE class for saving configurations |
group | name of section to write to |
void |
It reads the current dock state from the given section of KConfig.
Parameters:
c | KDE class for saving configurations |
group | name of section to read from |
void |
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* |
Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.
Returns: the wanted popup menu
void |
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:
dock | the dockwidget that is to be shown |
void |
This method hides the given dockwidget.
Parameters:
dock | the dockwidget that is to be shown |
void |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void |
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 |
Reimplemented from KTMainWindow.
void |
[protected slot]
Updates the dock-toolbar buttons and the internal information about the 4 dockwidgets that are directly docked to the main widget.
void |
[protected slot]
Inverts the state of the appropriate toggle-toolbutton of the dock-toolbar.
Parameters:
_ | index of the toolbutton |
void |
[protected slot]
Using the given parameters it updates the information about the 4 dockwidgets that are directly docked to the main widget.
Parameters:
oldDock | new main dockwidget |
newDock | old main dockwidget |
[protected]
Used as container for information about one of the 4 dockwidgets that are directly docked to the main dockwidget.
void |
[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:
toggled | specifies if the dockwidget gets docked or undocked |
data | reference to the struct containing information about the appropriate dockwidget |
KDockWidget* |
[protected]
A pointer to the main dockwidget (where one can manualDock() to
KDockManager* |
[protected]
A pointer to the manager for the dock process
DockPosData |
[protected]
Contains information about which dockwidget is docked on the left.
DockPosData |
[protected]
Contains information about which dockwidget is docked on the right.
DockPosData |
[protected]
Contains information about which dockwidget is docked at the top.
DockPosData |
[protected]
Contains information about which dockwidget is docked at the bottom.
KToolBar* |
[protected]
A pointer to the dock toolbar (for showing or hiding the 4 docked dockwidgets that are docked to the main dockwidget).