KDDockWidgets API Documentation
1.2.1
|
Represents a dock widget. More...
#include <DockWidgetQuick.h>
Public Member Functions | |
DockWidgetQuick (const QString &uniqueName, Options options={}) | |
constructs a new DockWidget More... | |
~DockWidgetQuick () override | |
destructor | |
QSize | maximumSize () const override |
QSize | minimumSize () const override |
void | setWidget (const QString &qmlFilename) |
void | setWidget (QWidgetAdapter *widget) override |
Public Member Functions inherited from KDDockWidgets::DockWidgetBase | |
DockWidgetBase (const QString &uniqueName, Options options=DockWidgetBase::Options()) | |
constructs a new DockWidget More... | |
~DockWidgetBase () override | |
destructor | |
void | addDockWidgetAsTab (DockWidgetBase *other, AddingOption addingOption=AddingOption_None) |
docks other widget into this one. Tabs will be shown if not already. More... | |
void | addDockWidgetToContainingWindow (DockWidgetBase *other, KDDockWidgets::Location location, DockWidgetBase *relativeTo=nullptr) |
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. | |
QAction * | floatAction () const |
Returns the QAction that allows to dock/undock the dock widget Useful to put in menus. | |
Q_INVOKABLE void | forceClose () |
Like QWidget::close() but the hosted widget won't be asked if we should close. | |
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 or tabbar 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. | |
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). | |
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. More... | |
bool | isMainWindow () const |
Returns whether widget() is a KDDockWidget::MainWindow. More... | |
bool | isOpen () const |
Returns whether this dock widget is open. Equivalent to calling toggleAction().isChecked() or isVisible() | |
bool | isOverlayed () const |
Returns whether this dock widget is overlayed on top of the main window, instead of docked into the layout. This is only relevant when using the auto-hide and side-bar feature. | |
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 | |
MainWindowBase * | mainWindow () const |
Returns the main window this dock widget is in. nullptr if it's not inside a main window. | |
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_INVOKABLE void | raise () |
Brings the dock widget to the front. More... | |
std::shared_ptr< LayoutSaver::DockWidget > | serialize () const |
Serializes this dock widget into an intermediate form. | |
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) |
void | setAsCurrentTab () |
Makes this dock widget current in its tab group. | |
bool | setFloating (bool floats) |
setter to make the dock widget float or dock. More... | |
void | setIcon (const QIcon &icon, IconPlaces places=IconPlace::All) |
Sets an icon to show on title bars and tab bars. 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... | |
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. | |
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. | |
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... | |
QAction * | toggleAction () const |
Returns the QAction that allows to hide/show the dock widget Useful to put in menus. | |
QString | uniqueName () const |
the dock widget's unique name. More... | |
QWidgetOrQuick * | widget () const |
returns the widget which this dock widget hosts | |
Protected Member Functions | |
bool | event (QEvent *e) override |
Protected Member Functions inherited from KDDockWidgets::DockWidgetBase | |
bool | eventFilter (QObject *, QEvent *) override |
void | onCloseEvent (QCloseEvent *e) override |
void | onHidden (bool spontaneous) |
void | onParentChanged () |
bool | onResize (QSize newSize) override |
void | onShown (bool spontaneous) |
Additional Inherited Members | |
Public Types inherited from KDDockWidgets::DockWidgetBase | |
enum | IconPlace { TitleBar = 1, TabBar = 2, All = TitleBar | TabBar } |
typedef QVector< DockWidgetBase * > | List |
enum | Option { Option_None = 0, Option_NotClosable = 1, Option_NotDockable = 2 } |
DockWidget options to pass at construction time. More... | |
Signals inherited from KDDockWidgets::DockWidgetBase | |
void | hidden () |
signal emitted when the DockWidget is hidden. As in QEvent::Hide. | |
void | iconChanged () |
signal emitted when the icon changed | |
void | isFloatingChanged (bool) |
emitted when isFloating changes | |
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 | |
void | removedFromSideBar () |
emitted when this dock widget is removed from a side-bar. Only relevant for the auto-hide/sidebar feature | |
void | shown () |
signal emitted when the DockWidget is shown. As in QEvent::Show. | |
void | titleChanged (const QString &title) |
signal emitted when the title changed More... | |
void | widgetChanged (KDDockWidgets::QWidgetOrQuick *) |
emitted when the hosted widget changed | |
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... | |
Static Public Member Functions inherited from KDDockWidgets::DockWidgetBase | |
static DockWidgetBase * | deserialize (const std::shared_ptr< LayoutSaver::DockWidget > &) |
Constructs a dock widget from its serialized form. More... | |
Properties inherited from KDDockWidgets::DockWidgetBase | |
bool | isFloating |
bool | isFocused |
Represents a dock widget.
Most of the interface lives in DockWidgetBase, to facilitate sharing with QtQuick.
|
explicit |
constructs a new DockWidget
name | the name of the dockwidget, should be unique. Use title for user visible text. |
options | optional options controlling behaviour |
parent | optional QWidget parent, for ownership purposes |
There's no parent argument. The DockWidget is either parented to FloatingWindow or MainWindow when visible, or stays without a parent when hidden.
void DockWidgetQuick::setWidget | ( | const QString & | qmlFilename | ) |
Sets the DockWidget's guest item Similar to DockWidgetBase::setWidget(QQuickItem*)