KDDockWidgets API Documentation  1.5
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KDDockWidgets::DockWidgetQuick Class Reference

Represents a dock widget. More...

#include <DockWidgetQuick.h>

Inheritance diagram for KDDockWidgets::DockWidgetQuick:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::DockWidgetQuick:
Collaboration graph
[legend]

Signals

void frameGeometryChanged (QRect)
 The geometry of the frame container this dock widget is in changed For example, when dragging a dockwidget. More...
 
- Signals inherited from KDDockWidgets::DockWidgetBase
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

 DockWidgetQuick (const QString &uniqueName, Options options={}, LayoutSaverOptions layoutSaverOptions=LayoutSaverOptions(), QQmlEngine *engine=nullptr)
 constructs a new DockWidget More...
 
 ~DockWidgetQuick () override
 destructor More...
 
TitleBar * actualTitleBar () const
 Returns the title bar. More...
 
QObjectactualTitleBarObj () const
 Returns the title bar Qt6 requires us to include TitleBar_p.h, so instead the Q_PROPERTY uses QObject so we don't include private headers in public headers. More...
 
Q_INVOKABLE KDDockWidgets::Frame * frame () const
 
QQuickItem * frameVisualItem () const
 Returns the visual item which represents Frame in the screen Equivalent to Frame::visualItem(). More...
 
QSize maximumSize () const override
 Reimplemented for internal purposes.
. More...
 
QSize minimumSize () const override
 Reimplemented for internal purposes.
. More...
 
Q_INVOKABLE void onGeometryUpdated ()
 Called by QtQuick when min-size changes. More...
 
void setWidget (const QString &qmlFilename)
 
Q_INVOKABLE void setWidget (QQuickItem *widget)
 Reimplemented for internal purposes.
. More...
 
void setWidget (QWidgetAdapter *widget) override
 Reimplemented for internal purposes.
. More...
 
- Public Member Functions inherited from KDDockWidgets::DockWidgetBase
 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...
 
Q_INVOKABLE QActionfloatAction () 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...
 
MainWindowBasemainWindow () 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 which tab index this dock widget occupies in the tab widget it's contained in. 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 QActiontoggleAction () 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
 
QWidgetOrQuickwidget () const
 returns the widget which this dock widget hosts More...
 

Protected Member Functions

bool event (QEvent *e) override
 
- Protected Member Functions inherited from KDDockWidgets::DockWidgetBase
void onCloseEvent (QCloseEvent *e) override
 
void onHidden (bool spontaneous)
 
void onParentChanged ()
 
bool onResize (QSize newSize) override
 
void onShown (bool spontaneous)
 

Properties

QObjectactualTitleBar
 
- Properties inherited from KDDockWidgets::DockWidgetBase
bool isFloating
 
bool isFocused
 
KDDockWidgets::DockWidgetBase::Options options
 
QString title
 
QString uniqueName
 
QObjectwidget
 

Additional Inherited Members

- Public Types inherited from KDDockWidgets::DockWidgetBase
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 }
 DockWidget options to pass at construction time. More...
 
- Static Public Member Functions inherited from KDDockWidgets::DockWidgetBase
static DockWidgetBasebyName (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...
 

Detailed Description

Represents a dock widget.

Most of the interface lives in DockWidgetBase, to facilitate sharing with QtQuick.

Definition at line 39 of file DockWidgetQuick.h.

Constructor & Destructor Documentation

◆ DockWidgetQuick()

DockWidgetQuick::DockWidgetQuick ( const QString uniqueName,
Options  options = {},
LayoutSaverOptions  layoutSaverOptions = LayoutSaverOptions(),
QQmlEngine *  engine = nullptr 
)
explicit

constructs a new DockWidget

Parameters
uniqueNamethe name of the dockwidget, should be unique. Use title for user visible text.
optionsoptional options controlling behaviour
layoutSaverOptionsoptions regarding LayoutSaver behaviour
enginethe QML engine this dock widget will be created on. If not specified then Config::self().qmlEngine() will be used

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 51 of file DockWidgetQuick.cpp.

◆ ~DockWidgetQuick()

DockWidgetQuick::~DockWidgetQuick ( )
override

destructor

Definition at line 60 of file DockWidgetQuick.cpp.

Member Function Documentation

◆ actualTitleBar()

TitleBar * DockWidgetQuick::actualTitleBar ( ) const

Returns the title bar.

Definition at line 133 of file DockWidgetQuick.cpp.

References KDDockWidgets::DockWidgetBase::Frame, and frame().

◆ actualTitleBarObj()

QObject * DockWidgetQuick::actualTitleBarObj ( ) const

Returns the title bar Qt6 requires us to include TitleBar_p.h, so instead the Q_PROPERTY uses QObject so we don't include private headers in public headers.

Definition at line 140 of file DockWidgetQuick.cpp.

References actualTitleBar.

◆ event()

bool DockWidgetQuick::event ( QEvent e)
overrideprotected

◆ frame()

Frame * DockWidgetQuick::frame ( ) const

Definition at line 161 of file DockWidgetQuick.cpp.

Referenced by actualTitleBar(), frameVisualItem(), and onGeometryUpdated().

◆ frameGeometryChanged

void KDDockWidgets::DockWidgetQuick::frameGeometryChanged ( QRect  )
signal

The geometry of the frame container this dock widget is in changed For example, when dragging a dockwidget.

◆ frameVisualItem()

QQuickItem * DockWidgetQuick::frameVisualItem ( ) const

Returns the visual item which represents Frame in the screen Equivalent to Frame::visualItem().

Definition at line 145 of file DockWidgetQuick.cpp.

References frame().

◆ maximumSize()

QSize DockWidgetQuick::maximumSize ( ) const
override

Reimplemented for internal purposes.
.

Definition at line 123 of file DockWidgetQuick.cpp.

References KDDockWidgets::DockWidgetBase::widget.

◆ minimumSize()

QSize DockWidgetQuick::minimumSize ( ) const
override

Reimplemented for internal purposes.
.

Definition at line 113 of file DockWidgetQuick.cpp.

References KDDockWidgets::DockWidgetBase::widget.

◆ onGeometryUpdated()

void DockWidgetQuick::onGeometryUpdated ( )

Called by QtQuick when min-size changes.

Definition at line 153 of file DockWidgetQuick.cpp.

References frame().

◆ setWidget() [1/3]

void DockWidgetQuick::setWidget ( const QString qmlFilename)

Sets the DockWidget's guest item Similar to DockWidgetBase::setWidget(QQuickItem*)

Definition at line 65 of file DockWidgetQuick.cpp.

Referenced by setWidget().

◆ setWidget() [2/3]

void DockWidgetQuick::setWidget ( QQuickItem *  widget)

Reimplemented for internal purposes.
.

Definition at line 81 of file DockWidgetQuick.cpp.

References QVariant::fromValue(), and setWidget().

◆ setWidget() [3/3]

void DockWidgetQuick::setWidget ( QWidgetAdapter *  widget)
override

Reimplemented for internal purposes.
.

Definition at line 74 of file DockWidgetQuick.cpp.

References KDDockWidgets::DockWidgetBase::setWidget(), and KDDockWidgets::DockWidgetBase::widget.

Property Documentation

◆ actualTitleBar

QObject * KDDockWidgets::DockWidgetQuick::actualTitleBar
read

Definition at line 27 of file DockWidgetQuick.h.

Referenced by actualTitleBarObj().


The documentation for this class was generated from the following files:

© 2019-2022 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated on Mon Mar 7 2022 02:01:21 for KDDockWidgets API Documentation by doxygen 1.8.20