KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
DockWidgetViewInterface.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
13#include "kddockwidgets/core/Group.h"
14#include "kddockwidgets/core/DockWidget.h"
15#include "core/DockWidget_p.h"
16
17namespace KDDockWidgets::Core {
18
20 : m_dockWidget(controller)
21{
22}
23
25{
26 return m_dockWidget->dptr()->group();
27}
28
33
35{
36 if (Group *group = this->group())
37 return group->actualTitleBar();
38 return nullptr;
39}
40
42
47
52
57
62
67
72
77
79{
80 return m_dockWidget->isOpen();
81}
82
87
92
97
102
107
109 const KDDockWidgets::InitialOption &initialOption)
110{
111 DockWidget *dw = other ? other->dockWidget() : nullptr;
112 m_dockWidget->addDockWidgetAsTab(dw, initialOption);
113}
114
117 DockWidgetViewInterface *relativeTo, const KDDockWidgets::InitialOption &initialOption)
118{
119 DockWidget *dw = other ? other->dockWidget() : nullptr;
120 DockWidget *relativeToDw = relativeTo ? relativeTo->dockWidget() : nullptr;
121 m_dockWidget->addDockWidgetToContainingWindow(dw, location, relativeToDw, initialOption);
122}
123
124DockWidgetOptions DockWidgetViewInterface::options() const
125{
126 return m_dockWidget->options();
127}
128
129void DockWidgetViewInterface::setOptions(DockWidgetOptions opts)
130{
132}
133
134void DockWidgetViewInterface::setIcon(const Icon &icon, IconPlaces places)
135{
136 m_dockWidget->setIcon(icon, places);
137}
138
140{
141 return m_dockWidget->icon(place);
142}
143
148
153
158
163
165{
167}
168
173
174} // namespace
The interface that DockWidget views should implement.
void addDockWidgetToContainingWindow(DockWidgetViewInterface *other, KDDockWidgets::Location location, DockWidgetViewInterface *relativeTo=nullptr, const KDDockWidgets::InitialOption &initialOption={})
Icon icon(IconPlace place=IconPlace::TitleBar) const
void setMDISize(Size size)
like setMDIPosition(), but for the size.
void setMDIZ(int z)
like setMDIPosition(), but for the Z only implemented for QtQuick
void setMDIPosition(Point pos)
Sets this dock widgets position to pos within the MDI layout This only applies if the main window is ...
void addDockWidgetAsTab(DockWidgetViewInterface *other, const KDDockWidgets::InitialOption &initialOption={})
void setIcon(const Icon &icon, IconPlaces places=IconPlace::All)
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
void setMDISize(Size size)
like setMDIPosition(), but for the size.
bool setFloating(bool floats)
setter to make the dock widget float or dock.
void setAsCurrentTab()
Makes this dock widget current in its tab group.
void setTitle(const QString &title)
setter for the dock widget's title
QString uniqueName() const
the dock widget's unique name.
void addDockWidgetToContainingWindow(KDDockWidgets::Core::DockWidget *other, KDDockWidgets::Location location, KDDockWidgets::Core::DockWidget *relativeTo=nullptr, const KDDockWidgets::InitialOption &initialOption={})
docks other widget into the window that contains this one. Equivalent to MainWindow::addDockWidget() ...
void addDockWidgetAsTab(KDDockWidgets::Core::DockWidget *other, const KDDockWidgets::InitialOption &initialOption={})
docks other widget into this one. Tabs will be shown if not already.
void setOptions(DockWidgetOptions)
Setter for the options. Only DockWidetOption_NotClosable is allowed to change after construction....
Vector< QString > affinities() const
Returns the affinity name. Empty by default.
bool isOpen() const
Returns whether this dock widget is open. Equivalent to calling toggleAction().isChecked()
Icon icon(IconPlace place=IconPlace::TitleBar) const
Returns the dock widget's titlebar, tabbar, or toggle action icon (depending on the passed place)
void setIcon(const Icon &icon, IconPlaces places=IconPlace::All)
Sets an icon to show on title bars and tab bars.
void open()
Opens this dock widget. Does nothing if already open. The dock widget will appear floating unless it ...
bool isFocused() const
Returns whether This or any child of this dock widget is focused Not to be confused with QWidget::has...
void setMDIZ(int z)
like setMDIPosition(), but for the Z only implemented for QtQuick
QString title() const
Returns the dock widget's title. This title is visible in title bars and tab bars.
void moveToSideBar()
Minimizes this dock widget to the MainWindow's side-bar.
bool isFloating() const
Returns whether the dock widget is floating. Floating means it's not docked and has a window of its o...
void setMDIPosition(Point pos)
Sets this dock widgets position to pos within the MDI layout This only applies if the main window is ...
void raise()
Brings the dock widget to the front.
void setAffinities(const Vector< QString > &)
Sets the affinity names. Dock widgets can only dock into dock widgets of the same affinity.
DockWidgetOptions options() const
Returns the dock widget's options which control behaviour.
void forceClose()
Like QWidget::close() but the hosted widget won't be asked if we should close.
void setAffinityName(const QString &name)
Core::TitleBar * actualTitleBar() const
Struct describing the preferred dock widget size and visibility when adding it to a layout.

© 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 by doxygen 1.9.8