|
|
Floatable widget that can be dragged around with the mouse und encapsulate the actual widgets (and member of the dockwidget class set).
You just grip the double-lined panel, tear it off its parent widget, drag it somewhere and let it loose. Depending on the position where you leave it, the dockwidget becomes a toplevel window on the desktop (floating mode) or docks to a new widget (dock mode). + Note: A KDockWidget can only be docked to a KDockWidget.
If you want to use this kind of widget, your main application window has to be a KDockMainWindow. That is because it has got several additional dock management features, for instance a KDockManager that has an overview over all dockwidgets and and a dockmovemanager (internal class) that handles the dock process.
Usually you create an KDockWidget that covers the actual widget in this way:
... KDockMainWindow* mainWidget; ... KDockWidget* dock = 0L; dock = mainWidget->createDockWidget( "Any window caption", nicePixmap); QWidget actualWidget( dock); dock->setWidget( actualWidget); ...
See KDockMainWindow how a dockwidget is docked in.
|
Constructs 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:
dockManager | the responsible manager (dock helper) |
name | object instance name |
pixmap | an icon (for instance shown when docked centered) |
parent | parent widget |
~ |
[virtual]
Destructs a dockwidget.
enum |
The possible positions where a dockwidget can dock to another dockwidget
KDockWidget* |
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:
target | the dockwidget to dock to |
dockPos | one of the DockPositions this is going to dock to |
spliPos | the split relation (in percent) between both dockwidgets, target and this |
pos | the dock position, mainly of interest for docking to the desktop (as toplevel dockwidget) |
check | only for internal use; |
Returns: result the group dockwidget that replaces the target dockwidget and will be grandparent of target and this
void |
Specify where it is either possible or impossible for this to dock to another dockwidget.
Parameters:
pos | an OR'ed set of DockPositions |
int |
Returns: where it is either possible or impossible for this to dock to another dockwidget (an OR'ed set of DockPositions)
void |
Specify where it is either possible or impossible for another dockwidget to dock to this.
Parameters:
pos | an OR'ed set of DockPositions |
int |
Returns: where it is either possible or impossible for another dockwidget to dock to this (an OR'ed set of DockPositions)
void |
Set the embedded widget. A QLayout takes care about proper resizing, automatically.
Parameters:
w | the pointer to the dockwidget's child widget |
QWidget* |
Get the embedded widget.
Returns: the pointer to the dockwidget's child widget, 0L if there's no such child
void |
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:
ah | a base class pointer to the dockwidget header |
void |
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 |
Returns: if it may be possible to hide this. There are reasons that it's impossible: <UL><LI>it is a (tab) group</LI> <LI>it is invisible, already ;-)</LI> <LI>the parent of this is the KDockMainWindow</LI> <LI>it isn't able to dock to another widget</LI></UL>
bool |
Returns: if it may be possible to show this There are reasons that it's impossible: <UL><LI>it is a (tab) group</LI> <LI>it is visible, already ;-)</LI> <LI>the parent of this is the KDockMainWindow</LI></UL>
KDockManager* |
Returns: the dockmanager that is responsible for this.
void |
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:
ttStr | a string for the tooltip on the tab |
const QString& |
Returns: the tooltip string being shown on the appropriate tab page header when in dock-centered mode.
bool |
@return true, if a dockback is possible, otherwise false.
bool |
[virtual]
Catches and processes some QWidget events that are interesting for dockwidgets.
void |
[virtual]
Add dockwidget management actions to QWidget::show.
void |
[slot]
Docks a dockwidget back to the dockwidget that was the neighbor widget before the current dock position.
void |
[slot]
Toggles the visibility state of the dockwidget if it is able to be shown or to be hidden.
void |
[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* |
[protected]
Returns: the parent widget of this if it inherits class KDockTabGroup
void |
[protected]
Check some conditions and show or hide the dockwidget header (drag panel). The header is hidden if: <LU><LI>the parent widget is the KDockMainWindow</LI> <LI>this is a (tab) group dockwidget</LI> <LI>it is not able to dock to another dockwidgets</LI>
void |
[signal]
Emits that another dockwidget is docking to this.
Parameters:
dw | the dockwidget that is docking to this |
dp | the DockPosition where it wants to dock to |
void |
[signal]
Signals that the dock default position is set.
void |
[signal]
Signals that the close button of the panel (KDockWidgetHeader) has been clicked.
void |
[signal]
Signals that the dockback button of the panel (KDockWidgetHeader) has been clicked.
void |
[signal]
Signals that the widget processes a close event.
void |
[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* |
[protected]
earlier closest neighbor widget, so it's possible to dock back to it.
DockPosition |
[protected]
the current dock position.
DockPosition |
[protected]
the former dock position when it really was at another position before.
QString |
[protected]
a string used as tooltip for the tab page header when in dock-centered mode.