KDDockWidgets API Documentation
1.6
|
The DockWidget base-class. DockWidget and DockWidgetBase are only split in two so we can share some code with the QtQuick implementation, which also derives from DockWidgetBase. More...
#include <DockWidgetBase.h>
Public Types | |
enum | IconPlace { IconPlace::TitleBar = 1, IconPlace::TabBar = 2, IconPlace::ToggleAction = 4, IconPlace::All = ToggleAction | TitleBar | TabBar } |
enum | LayoutSaverOption { LayoutSaverOption::None = 0, LayoutSaverOption::Skip = 1 } |
Options which will affect LayoutSaver save/restore. More... | |
typedef QVector< DockWidgetBase * > | List |
enum | Option { Option_None = 0, Option_NotClosable = 1, Option_NotDockable = 2, Option_DeleteOnClose = 4, Option_MDINestable = 8 } |
DockWidget options to pass at construction time. More... | |
Signals | |
void | aboutToDeleteOnClose () |
Emitted when this dock widget is about to be deleted due to Option_DeleteOnClose. More... | |
void | actualTitleBarChanged () |
Emitted when the title bar that serves this dock widget changes. More... | |
void | hidden () |
signal emitted when the DockWidget is hidden. As in QEvent::Hide. More... | |
void | iconChanged () |
signal emitted when the icon changed More... | |
void | isFloatingChanged (bool) |
emitted when isFloating changes More... | |
void | isFocusedChanged (bool) |
emitted when isFocused changes More... | |
void | isOverlayedChanged (bool) |
emitted when isOverlayed changes More... | |
void | optionsChanged (KDDockWidgets::DockWidgetBase::Options) |
emitted when the options change More... | |
void | parentChanged () |
signal emitted when the parent changed QtQuick already has QQuickItem::parentChanged(), so add it only for QtWidgets here. More... | |
void | removedFromSideBar () |
emitted when this dock widget is removed from a side-bar. Only relevant for the auto-hide/sidebar feature More... | |
void | shown () |
signal emitted when the DockWidget is shown. As in QEvent::Show. More... | |
void | titleChanged (const QString &title) |
signal emitted when the title changed More... | |
void | widgetChanged (KDDockWidgets::QWidgetOrQuick *) |
emitted when the hosted widget changed More... | |
void | windowActiveAboutToChange (bool activated) |
Emitted when the top-level window this dock widget is in is activated or deactivated This is convenience to replace tracking dockWidget->window(), since the window changes when docking and undocking. More... | |
Public Member Functions | |
DockWidgetBase (const QString &uniqueName, Options options=KDDockWidgets::DockWidgetBase::Options(), LayoutSaverOptions layoutSaverOptions=KDDockWidgets::DockWidgetBase::LayoutSaverOptions()) | |
constructs a new DockWidget More... | |
~DockWidgetBase () override | |
destructor More... | |
Q_INVOKABLE void | addDockWidgetAsTab (KDDockWidgets::DockWidgetBase *other, KDDockWidgets::InitialOption initialOption={}) |
docks other widget into this one. Tabs will be shown if not already. More... | |
Q_INVOKABLE void | addDockWidgetToContainingWindow (KDDockWidgets::DockWidgetBase *other, KDDockWidgets::Location location, KDDockWidgets::DockWidgetBase *relativeTo=nullptr, KDDockWidgets::InitialOption initialOption={}) |
docks other widget into the window that contains this one. Equivalent to MainWindow::addDockWidget() with the difference that it also supports the case where the top-level window is a FloatingWindow instead of MainWindow. More... | |
QStringList | affinities () const |
Returns the affinity name. Empty by default. More... | |
int | currentTabIndex () const |
Returns the index of the current tab of the tab group this dock widget is in. More... | |
Q_INVOKABLE QAction * | floatAction () const |
Returns the QAction that allows to dock/undock the dock widget Useful to put in menus. More... | |
Q_INVOKABLE void | forceClose () |
Like QWidget::close() but the hosted widget won't be asked if we should close. More... | |
QRect | frameGeometry () const |
Returns the size of the dock widget's parent frame. More... | |
bool | hasPreviousDockedLocation () const |
Returns whether this floating dock widget knows its previous docked location Result only makes sense if it's floating. More... | |
QIcon | icon (IconPlace place=IconPlace::TitleBar) const |
Returns the dock widget's titlebar, tabbar, or toggle action icon (depending on the passed place ) More... | |
bool | isCurrentTab () const |
Returns true if this dock widget is the current one in the tab widget that contains it. If the dock widget is alone then true is returned, as in this case there will also be a tab widget even though it's invisible. More... | |
bool | isFloating () const |
Returns whether the dock widget is floating. Floating means it's not docked and has a window of its own. Note that if you dock a floating dock widget into another floating one then they don't count as floating anymore, as they are side-by-side (or tabbed). More... | |
bool | isFocused () const |
Returns whether This or any child of this dock widget is focused Not to be confused with QWidget::hasFocus(), which just refers to 1 widget. This includes variant includes children. More... | |
bool | isInMainWindow () const |
Returns whether this dock widget is docked into a main window (as opposed to floating) More... | |
bool | isInSideBar () const |
Returns where this dockwidget is in a sidebar Similar to sideBarLocation(), but returns a bool. More... | |
bool | isMainWindow () const |
Returns whether widget() is a KDDockWidget::MainWindow. More... | |
Q_INVOKABLE bool | isOpen () const |
Returns whether this dock widget is open. Equivalent to calling toggleAction().isChecked() or isVisible() More... | |
bool | isOverlayed () const |
Returns whether this dock widget is overlayed from the side-bar. More... | |
bool | isPersistentCentralDockWidget () const |
Returns whether this dock widget is the main window persistent central widget This only applies when using MainWindowOption_HasCentralWidget. More... | |
bool | isTabbed () const |
returns if this dock widget is tabbed into another More... | |
QSize | lastOverlayedSize () const |
returns the last size the widget has when overlayed Empty otherwise More... | |
KDDockWidgets::DockWidgetBase::LayoutSaverOptions | layoutSaverOptions () const |
returns the per-dockwidget options which will affect LayoutSaver These are the options which were passed to the constructor More... | |
MainWindowBase * | mainWindow () const |
Returns the main window this dock widget is in. nullptr if it's not inside a main window Also returns nullptr if it's minimized to a sidebar. More... | |
Q_INVOKABLE void | moveToSideBar () |
Minimizes this dock widget to the MainWindow's side-bar. More... | |
Options | options () const |
Returns the dock widget's options which control behaviour. More... | |
Q_ENUM (Options) | |
Q_INVOKABLE void | raise () |
Brings the dock widget to the front. More... | |
void | setAffinities (const QStringList &) |
Sets the affinity names. Dock widgets can only dock into dock widgets of the same affinity. More... | |
void | setAffinityName (const QString &name) |
Q_INVOKABLE void | setAsCurrentTab () |
Makes this dock widget current in its tab group. More... | |
bool | setFloating (bool floats) |
setter to make the dock widget float or dock. More... | |
void | setFloatingGeometry (QRect geo) |
If this dock widget is floating, then sets its geometry to geo . More... | |
void | setIcon (const QIcon &icon, IconPlaces places=IconPlace::All) |
Sets an icon to show on title bars and tab bars. More... | |
void | setMDIPosition (QPoint pos) |
Sets this dock widgets position to pos within the MDI layout This only applies if the main window is in MDI mode, which it is not by default. More... | |
void | setMDISize (QSize size) |
like setMDIPosition(), but for the size. More... | |
void | setMDIZ (int z) |
like setMDIPosition(), but for the Z only implemented for QtQuick More... | |
void | setOptions (Options) |
Setter for the options. Only Option_NotClosable is allowed to change after construction. For the other options use the constructor only. More... | |
void | setTitle (const QString &title) |
setter for the dock widget's title More... | |
void | setUserType (int userType) |
Allows the user to set a type on this dock widget The type is opaque and will not be interpreted by KDDockWidgets. This type is passed to FrameWorkWidgetFactory::createTitleBar(), which the user can override and return different TitleBar subclasses, depending on the type. More... | |
virtual void | setWidget (QWidgetOrQuick *widget) |
sets the widget which this dock widget hosts. More... | |
Q_INVOKABLE void | show () |
Equivalent to QWidget::show(), but it's optimized to reduce flickering on some platforms. More... | |
SideBarLocation | sideBarLocation () const |
Returns whether this dock widget is in a side bar, and which. SideBarLocation::None is returned if it's not in a sidebar. This is only relevant when using the auto-hide and side-bar feature. More... | |
bool | skipsRestore () const |
Returns whether this widget has the LayoutSaverOption::Skip flag. More... | |
int | tabIndex () const |
Returns the tab index this dock widget occupies Note that dock widgets are almost always tabbed, even if you don't see the tab bar. A single floating dock widget is still tabbed on a tab widget with a single tab. More... | |
QString | title () const |
Returns the dock widget's title. This title is visible in title bars and tab bars. More... | |
TitleBar * | titleBar () const |
Returns this dock widget's title bar. More... | |
Q_INVOKABLE QAction * | toggleAction () const |
Returns the QAction that allows to hide/show the dock widget Useful to put in menus. More... | |
QString | uniqueName () const |
the dock widget's unique name. More... | |
int | userType () const |
QWidgetOrQuick * | widget () const |
returns the widget which this dock widget hosts More... | |
Static Public Member Functions | |
static DockWidgetBase * | byName (const QString &uniqueName) |
Returns a dock widget by its name This is the same name you passed to DockWidget CTOR. nullptr is returned if the dock widget isn't found. More... | |
Protected Member Functions | |
void | onCloseEvent (QCloseEvent *e) override |
void | onHidden (bool spontaneous) |
void | onParentChanged () |
bool | onResize (QSize newSize) override |
void | onShown (bool spontaneous) |
Properties | |
bool | isFloating |
bool | isFocused |
KDDockWidgets::DockWidgetBase::Options | options |
QString | title |
QString | uniqueName |
QObject * | widget |
The DockWidget base-class. DockWidget and DockWidgetBase are only split in two so we can share some code with the QtQuick implementation, which also derives from DockWidgetBase.
Do not use instantiate directly in user code. Use DockWidget instead.
Definition at line 57 of file DockWidgetBase.h.
Definition at line 71 of file DockWidgetBase.h.
|
strong |
Enumerator | |
---|---|
TitleBar | |
TabBar | |
ToggleAction | |
All |
Definition at line 93 of file DockWidgetBase.h.
|
strong |
Options which will affect LayoutSaver save/restore.
Enumerator | |
---|---|
None | Just use the defaults. |
Skip | The dock widget won't participate in save/restore. Currently only available for floating windows. |
Definition at line 87 of file DockWidgetBase.h.
DockWidget options to pass at construction time.
Enumerator | |
---|---|
Option_None | No option, the default. |
Option_NotClosable | The DockWidget can't be closed on the [x], only programmatically. |
Option_NotDockable | The DockWidget can't be docked, it's always floating. |
Option_DeleteOnClose | Deletes the DockWidget when closed. |
Option_MDINestable | EXPERIMENTAL. When this dock widget is being shown in a MDI area it will also allow other dock widgets to be dropped to its sides and tabbed Usually Each MDI "window" corresponds to one DockWidget, with this option each "window" will have a layout with 1 or more dock widgets Run "kddockwidgets_mdi_with_docking_example -n" to see it in action |
Definition at line 74 of file DockWidgetBase.h.
|
explicit |
constructs a new DockWidget
uniqueName | the name of the dockwidget, should be unique. Use title for user visible text. |
options | the options controlling certain behaviours |
layoutSaverOptions | the options to control save/restore |
There's no parent argument. The DockWidget is either parented to FloatingWindow or MainWindow when visible, or stays without a parent when hidden.
Definition at line 43 of file DockWidgetBase.cpp.
References QString::isEmpty(), and Qt::WA_PendingMoveEvent.
|
override |
destructor
Definition at line 57 of file DockWidgetBase.cpp.
|
signal |
Emitted when this dock widget is about to be deleted due to Option_DeleteOnClose.
|
signal |
Emitted when the title bar that serves this dock widget changes.
Referenced by KDDockWidgets::DockWidgetQuick::event(), and onParentChanged().
void DockWidgetBase::addDockWidgetAsTab | ( | KDDockWidgets::DockWidgetBase * | other, |
KDDockWidgets::InitialOption | initialOption = {} |
||
) |
docks other
widget into this one. Tabs will be shown if not already.
other | The other dock widget to dock into this one. |
initialOption | Allows to specify an InitialOption. Which is useful to add the dock widget as hidden, recording only a placeholder in the tab. So it's restored to tabbed when eventually shown. |
Definition at line 63 of file DockWidgetBase.cpp.
References affinities(), Frame, isPersistentCentralDockWidget(), Option_NotDockable, and options.
void DockWidgetBase::addDockWidgetToContainingWindow | ( | KDDockWidgets::DockWidgetBase * | other, |
KDDockWidgets::Location | location, | ||
KDDockWidgets::DockWidgetBase * | relativeTo = nullptr , |
||
KDDockWidgets::InitialOption | initialOption = {} |
||
) |
docks other
widget into the window that contains this one. Equivalent to MainWindow::addDockWidget() with the difference that it also supports the case where the top-level window is a FloatingWindow instead of MainWindow.
other | The other dock widget to dock into the window. |
location | The location to dock. |
relativeTo | The dock widget that the location is relative to. If null then the window is considered |
initialOption | Allows to specify some extra options that are used while docking. |
Definition at line 116 of file DockWidgetBase.cpp.
References KDDockWidgets::MainWindowBase::addDockWidget(), affinities(), mainWindow(), Option_NotDockable, and options.
QStringList DockWidgetBase::affinities | ( | ) | const |
Returns the affinity name. Empty by default.
Definition at line 385 of file DockWidgetBase.cpp.
Referenced by KDDockWidgets::MainWindowBase::addDockWidgetAsTab(), addDockWidgetAsTab(), addDockWidgetToContainingWindow(), and setAffinities().
|
static |
Returns a dock widget by its name This is the same name you passed to DockWidget CTOR. nullptr is returned if the dock widget isn't found.
Definition at line 495 of file DockWidgetBase.cpp.
References uniqueName.
int DockWidgetBase::currentTabIndex | ( | ) | const |
Returns the index of the current tab of the tab group this dock widget is in.
Definition at line 331 of file DockWidgetBase.cpp.
References Frame.
QAction * DockWidgetBase::floatAction | ( | ) | const |
Returns the QAction that allows to dock/undock the dock widget Useful to put in menus.
Definition at line 228 of file DockWidgetBase.cpp.
void DockWidgetBase::forceClose | ( | ) |
Like QWidget::close() but the hosted widget won't be asked if we should close.
Definition at line 367 of file DockWidgetBase.cpp.
Referenced by KDDockWidgets::MainWindowBase::closeDockWidgets(), and KDDockWidgets::MainWindowBase::moveToSideBar().
QRect DockWidgetBase::frameGeometry | ( | ) | const |
Returns the size of the dock widget's parent frame.
This will always be bigger than the DockWidget's size, as there's margins and a title bar. Also, a frame can contain more than 1 dock widget (tabbed), meaning the geometry will account for the tab bar and title bar.
The position of the rect is in layout coordinates. 0,0 is the top-left of the layout holding the widgets.
Definition at line 263 of file DockWidgetBase.cpp.
References Frame.
bool DockWidgetBase::hasPreviousDockedLocation | ( | ) | const |
Returns whether this floating dock widget knows its previous docked location Result only makes sense if it's floating.
When you call dockWidget->setFloating(false) it will only dock if it knows where to.
Definition at line 485 of file DockWidgetBase.cpp.
|
signal |
signal emitted when the DockWidget is hidden. As in QEvent::Hide.
Referenced by onHidden().
QIcon DockWidgetBase::icon | ( | IconPlace | place = IconPlace::TitleBar | ) | const |
Returns the dock widget's titlebar, tabbar, or toggle action icon (depending on the passed place
)
By default it's null.
Definition at line 353 of file DockWidgetBase.cpp.
References TabBar, TitleBar, and ToggleAction.
Referenced by setIcon().
|
signal |
signal emitted when the icon changed
Referenced by setIcon().
bool DockWidgetBase::isCurrentTab | ( | ) | const |
Returns true if this dock widget is the current one in the tab widget that contains it. If the dock widget is alone then true is returned, as in this case there will also be a tab widget even though it's invisible.
Definition at line 308 of file DockWidgetBase.cpp.
References Frame.
Referenced by isFocused().
bool DockWidgetBase::isFloating | ( | ) | const |
Returns whether the dock widget is floating. Floating means it's not docked and has a window of its own. Note that if you dock a floating dock widget into another floating one then they don't count as floating anymore, as they are side-by-side (or tabbed).
Definition at line 170 of file DockWidgetBase.cpp.
|
signal |
emitted when isFloating changes
bool DockWidgetBase::isFocused | ( | ) | const |
Returns whether This or any child of this dock widget is focused Not to be confused with QWidget::hasFocus(), which just refers to 1 widget. This includes variant includes children.
Definition at line 432 of file DockWidgetBase.cpp.
References isCurrentTab().
|
signal |
emitted when isFocused changes
bool DockWidgetBase::isInMainWindow | ( | ) | const |
Returns whether this dock widget is docked into a main window (as opposed to floating)
Note that isFloating() returning false might either mean the dock widget is docked into a main window or into a floating window (groupped/nested with other dock widgets. Use this function then if you need to disambiguate
Definition at line 422 of file DockWidgetBase.cpp.
bool DockWidgetBase::isInSideBar | ( | ) | const |
Returns where this dockwidget is in a sidebar Similar to sideBarLocation(), but returns a bool.
Definition at line 480 of file DockWidgetBase.cpp.
References KDDockWidgets::None, and sideBarLocation().
bool DockWidgetBase::isMainWindow | ( | ) | const |
Returns whether widget() is a KDDockWidget::MainWindow.
This function doesn't have anything to do with this dock widget being inside a main window or not, but rather the inverse concept. It's not a very popular usage, but some applications want to dock a main window into another main window. This is done by putting it into a dock widget first.
See also kddockwidgets_example -j
Definition at line 417 of file DockWidgetBase.cpp.
References widget.
bool DockWidgetBase::isOpen | ( | ) | const |
Returns whether this dock widget is open. Equivalent to calling toggleAction().isChecked() or isVisible()
Definition at line 380 of file DockWidgetBase.cpp.
Referenced by raise(), and setFloatingGeometry().
bool DockWidgetBase::isOverlayed | ( | ) | const |
Returns whether this dock widget is overlayed from the side-bar.
This is only relevant when using the auto-hide and side-bar feature. Not to be confused with "floating", which means top-level window.
Definition at line 467 of file DockWidgetBase.cpp.
References mainWindow().
Referenced by onResize().
|
signal |
emitted when isOverlayed changes
Referenced by KDDockWidgets::MainWindowBase::overlayOnSideBar().
bool DockWidgetBase::isPersistentCentralDockWidget | ( | ) | const |
Returns whether this dock widget is the main window persistent central widget This only applies when using MainWindowOption_HasCentralWidget.
Definition at line 950 of file DockWidgetBase.cpp.
Referenced by addDockWidgetAsTab(), KDDockWidgets::MainWindowBase::moveToSideBar(), KDDockWidgets::MainWindowBase::overlayOnSideBar(), and setFloating().
bool DockWidgetBase::isTabbed | ( | ) | const |
returns if this dock widget is tabbed into another
Technically a docked DockWidget always lives in a tab widget, but from the user's perspective it's not tabbed when there's only 1 dock widget, as there are no tabs displayed. Unless the frame is using Option_AlwaysShowsTabs, in which case this method will return true regardless if being the single one.
Definition at line 297 of file DockWidgetBase.cpp.
References Frame, and isFloating.
Referenced by setFloating().
QSize DockWidgetBase::lastOverlayedSize | ( | ) | const |
returns the last size the widget has when overlayed Empty otherwise
Definition at line 490 of file DockWidgetBase.cpp.
DockWidgetBase::LayoutSaverOptions DockWidgetBase::layoutSaverOptions | ( | ) | const |
returns the per-dockwidget options which will affect LayoutSaver These are the options which were passed to the constructor
Definition at line 277 of file DockWidgetBase.cpp.
MainWindowBase * DockWidgetBase::mainWindow | ( | ) | const |
Returns the main window this dock widget is in. nullptr if it's not inside a main window Also returns nullptr if it's minimized to a sidebar.
Definition at line 427 of file DockWidgetBase.cpp.
Referenced by addDockWidgetToContainingWindow(), isOverlayed(), and moveToSideBar().
void DockWidgetBase::moveToSideBar | ( | ) |
Minimizes this dock widget to the MainWindow's side-bar.
It will be undocked from current layout. It's previous docked position will be remembered.
This action is only available if the dock widget is docked into a MainWindow. The dockwidget will initially be visible and overlayed on top of the current layout (this is the auto-hide feature).
Definition at line 461 of file DockWidgetBase.cpp.
References mainWindow().
|
overrideprotected |
Definition at line 873 of file DockWidgetBase.cpp.
References QEvent::accept(), and QEvent::isAccepted().
Referenced by KDDockWidgets::DockWidget::closeEvent(), and KDDockWidgets::DockWidgetQuick::event().
|
protected |
Definition at line 848 of file DockWidgetBase.cpp.
References Frame, and hidden().
Referenced by KDDockWidgets::DockWidget::event(), and KDDockWidgets::DockWidgetQuick::event().
|
protected |
Definition at line 818 of file DockWidgetBase.cpp.
References actualTitleBarChanged(), and parentChanged().
Referenced by KDDockWidgets::DockWidget::event(), and KDDockWidgets::DockWidgetQuick::event().
|
overrideprotected |
Definition at line 860 of file DockWidgetBase.cpp.
References isOverlayed().
|
protected |
Definition at line 831 of file DockWidgetBase.cpp.
References Frame, shown(), and QTimer::singleShot.
Referenced by KDDockWidgets::DockWidget::event(), and KDDockWidgets::DockWidgetQuick::event().
DockWidgetBase::Options DockWidgetBase::options | ( | ) | const |
Returns the dock widget's options which control behaviour.
Definition at line 272 of file DockWidgetBase.cpp.
|
signal |
|
signal |
signal emitted when the parent changed QtQuick already has QQuickItem::parentChanged(), so add it only for QtWidgets here.
Referenced by onParentChanged().
KDDockWidgets::DockWidgetBase::Q_ENUM | ( | Options | ) |
void DockWidgetBase::raise | ( | ) |
Brings the dock widget to the front.
This means:
This only applies if the dock widget is already open. If closed, does nothing.
Definition at line 401 of file DockWidgetBase.cpp.
References Frame, isOpen(), and setAsCurrentTab().
|
signal |
emitted when this dock widget is removed from a side-bar. Only relevant for the auto-hide/sidebar feature
void DockWidgetBase::setAffinities | ( | const QStringList & | affinityNames | ) |
Sets the affinity names. Dock widgets can only dock into dock widgets of the same affinity.
By default the affinity is empty and a dock widget can dock into any main window and into any floating window. Usually you won't ever need to call this function, unless you have requirements where certain dock widgets can only dock into certain other dock widgets and main windows.
Note: Call this function right after creating your dock widget, before adding to a main window and before restoring any layout.
Note: Currently you can only call this function once, to keep the code simple and avoid edge cases. This will only be changed if a good use case comes up that requires changing affinities multiple times.
names
the affinity names
Definition at line 443 of file DockWidgetBase.cpp.
References affinities(), and QList::removeAll().
Referenced by setAffinityName().
void DockWidgetBase::setAffinityName | ( | const QString & | name | ) |
name | the affinity name |
Definition at line 438 of file DockWidgetBase.cpp.
References setAffinities().
void DockWidgetBase::setAsCurrentTab | ( | ) |
Makes this dock widget current in its tab group.
Definition at line 317 of file DockWidgetBase.cpp.
References Frame.
Referenced by raise().
bool DockWidgetBase::setFloating | ( | bool | floats | ) |
setter to make the dock widget float or dock.
floats | If true makes the dock widget float, otherwise docks it. |
Returns true if the request was accomplished
Definition at line 179 of file DockWidgetBase.cpp.
References KDDockWidgets::Config::InternalFlag_DontShowWhenUnfloatingHiddenWindow, isFloating, isPersistentCentralDockWidget(), isTabbed(), KDDockWidgets::Config::self(), KDDockWidgets::SuggestedGeometryHint_PreserveCenter, and titleBar().
Referenced by KDDockWidgets::MainWindowBase::restoreFromSideBar().
void DockWidgetBase::setFloatingGeometry | ( | QRect | geo | ) |
If this dock widget is floating, then sets its geometry to geo
.
If this dock widget is hidden then it stores the geometry so it can be used the next time it becomes floating.
This is just convenience, equivalent to calling window()->setGeometry(rect), with the added bonus of remembering the requested geometry in case it's still hidden.
Definition at line 505 of file DockWidgetBase.cpp.
References isFloating, and isOpen().
void DockWidgetBase::setIcon | ( | const QIcon & | icon, |
IconPlaces | places = IconPlace::All |
||
) |
Sets an icon to show on title bars and tab bars.
places | Specifies where the icon will be shown (TitleBar, TabBar, ToggleAction, or All) |
By default there's no icon set.
Definition at line 339 of file DockWidgetBase.cpp.
References icon(), iconChanged(), TabBar, TitleBar, and ToggleAction.
void DockWidgetBase::setMDIPosition | ( | QPoint | pos | ) |
Sets this dock widgets position to pos within the MDI layout This only applies if the main window is in MDI mode, which it is not by default.
Definition at line 912 of file DockWidgetBase.cpp.
References MDILayoutWidget.
void DockWidgetBase::setMDISize | ( | QSize | size | ) |
like setMDIPosition(), but for the size.
Definition at line 924 of file DockWidgetBase.cpp.
References MDILayoutWidget.
void DockWidgetBase::setMDIZ | ( | int | z | ) |
like setMDIPosition(), but for the Z only implemented for QtQuick
Definition at line 936 of file DockWidgetBase.cpp.
References Frame.
void DockWidgetBase::setOptions | ( | Options | options | ) |
Setter for the options. Only Option_NotClosable is allowed to change after construction. For the other options use the constructor only.
Definition at line 282 of file DockWidgetBase.cpp.
References Option_NotDockable, options, optionsChanged(), and titleBar().
void DockWidgetBase::setTitle | ( | const QString & | title | ) |
setter for the dock widget's title
title | the dock widget's new title |
Definition at line 254 of file DockWidgetBase.cpp.
References title, and titleChanged().
void DockWidgetBase::setUserType | ( | int | userType | ) |
Allows the user to set a type on this dock widget The type is opaque and will not be interpreted by KDDockWidgets. This type is passed to FrameWorkWidgetFactory::createTitleBar(), which the user can override and return different TitleBar subclasses, depending on the type.
Definition at line 902 of file DockWidgetBase.cpp.
References userType().
|
virtual |
sets the widget which this dock widget hosts.
widget | the widget to show inside this dock widget. Must not be null. |
Ownership for widget
is transferred to DockWidgetBase. Ownsership for any previously existing widget is transferred back to the user. Meaning if you call setWidget(A) followed by setWidget(B) then A will have to be deleted by you, while B is owned by the dock widget.
Definition at line 148 of file DockWidgetBase.cpp.
References QWidget::sizePolicy, and widgetChanged().
Referenced by KDDockWidgets::MainWindowBase::setPersistentCentralWidget(), and KDDockWidgets::DockWidgetQuick::setWidget().
void DockWidgetBase::show | ( | ) |
Equivalent to QWidget::show(), but it's optimized to reduce flickering on some platforms.
Definition at line 390 of file DockWidgetBase.cpp.
References QWidget::show().
|
signal |
signal emitted when the DockWidget is shown. As in QEvent::Show.
Referenced by onShown().
SideBarLocation DockWidgetBase::sideBarLocation | ( | ) | const |
Returns whether this dock widget is in a side bar, and which. SideBarLocation::None is returned if it's not in a sidebar. This is only relevant when using the auto-hide and side-bar feature.
Definition at line 475 of file DockWidgetBase.cpp.
Referenced by isInSideBar().
bool DockWidgetBase::skipsRestore | ( | ) | const |
Returns whether this widget has the LayoutSaverOption::Skip flag.
Definition at line 500 of file DockWidgetBase.cpp.
References Skip.
int DockWidgetBase::tabIndex | ( | ) | const |
Returns the tab index this dock widget occupies Note that dock widgets are almost always tabbed, even if you don't see the tab bar. A single floating dock widget is still tabbed on a tab widget with a single tab.
Definition at line 323 of file DockWidgetBase.cpp.
References Frame.
QString DockWidgetBase::title | ( | ) | const |
Returns the dock widget's title. This title is visible in title bars and tab bars.
Definition at line 238 of file DockWidgetBase.cpp.
References widget.
TitleBar * DockWidgetBase::titleBar | ( | ) | const |
Returns this dock widget's title bar.
Note that several dock widgets can have the same title bar, in case they are tabbed together. Hidden dock widgets have no associated title bar.
Definition at line 372 of file DockWidgetBase.cpp.
References Frame.
Referenced by setFloating(), and setOptions().
|
signal |
QAction * DockWidgetBase::toggleAction | ( | ) | const |
Returns the QAction that allows to hide/show the dock widget Useful to put in menus.
Definition at line 223 of file DockWidgetBase.cpp.
QString DockWidgetBase::uniqueName | ( | ) | const |
the dock widget's unique name.
Definition at line 233 of file DockWidgetBase.cpp.
int DockWidgetBase::userType | ( | ) | const |
Definition at line 907 of file DockWidgetBase.cpp.
Referenced by setUserType().
QWidgetOrQuick * DockWidgetBase::widget | ( | ) | const |
returns the widget which this dock widget hosts
Definition at line 165 of file DockWidgetBase.cpp.
|
signal |
emitted when the hosted widget changed
Referenced by KDDockWidgets::DockWidget::DockWidget(), and setWidget().
|
signal |
Emitted when the top-level window this dock widget is in is activated or deactivated This is convenience to replace tracking dockWidget->window(), since the window changes when docking and undocking.
It's called 'aboutTo' because it's done in an event filter and the target window doesn't have it's 'activeWindow' property updated yet at this point.
|
readwrite |
Definition at line 1 of file DockWidgetBase.h.
Referenced by isTabbed(), setFloating(), and setFloatingGeometry().
|
read |
Definition at line 1 of file DockWidgetBase.h.
|
readwrite |
Definition at line 1 of file DockWidgetBase.h.
Referenced by KDDockWidgets::MDIArea::addDockWidget(), KDDockWidgets::MainWindowBase::addDockWidget(), addDockWidgetAsTab(), addDockWidgetToContainingWindow(), and setOptions().
|
readwrite |
Definition at line 1 of file DockWidgetBase.h.
Referenced by setTitle().
|
read |
Definition at line 1 of file DockWidgetBase.h.
Referenced by KDDockWidgets::MDIArea::addDockWidget(), and byName().
|
read |
Definition at line 1 of file DockWidgetBase.h.
Referenced by isMainWindow(), KDDockWidgets::DockWidgetQuick::maximumSize(), KDDockWidgets::DockWidgetQuick::minimumSize(), KDDockWidgets::MainWindowBase::persistentCentralWidget(), KDDockWidgets::DockWidgetQuick::setWidget(), and title().