KDDockWidgets API Documentation
2.0
Loading...
Searching...
No Matches
source
src
core
views
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
12
#include "
DockWidgetViewInterface.h
"
13
#include "kddockwidgets/core/Group.h"
14
#include "kddockwidgets/core/DockWidget.h"
15
#include "core/DockWidget_p.h"
16
17
namespace
KDDockWidgets::Core
{
18
19
DockWidgetViewInterface::DockWidgetViewInterface
(
DockWidget
*controller)
20
: m_dockWidget(controller)
21
{
22
}
23
24
Group
*
DockWidgetViewInterface::group
()
const
25
{
26
return
m_dockWidget
->
dptr
()->group();
27
}
28
29
DockWidget
*
DockWidgetViewInterface::dockWidget
()
const
30
{
31
return
m_dockWidget
;
32
}
33
34
TitleBar
*
DockWidgetViewInterface::actualTitleBar
()
const
35
{
36
if
(
Group
*
group
= this->
group
())
37
return
group
->
actualTitleBar
();
38
return
nullptr
;
39
}
40
41
DockWidgetViewInterface::~DockWidgetViewInterface
() =
default
;
42
43
bool
DockWidgetViewInterface::isFocused
()
const
44
{
45
return
m_dockWidget
->
isFocused
();
46
}
47
48
bool
DockWidgetViewInterface::isFloating
()
const
49
{
50
return
m_dockWidget
->
isFloating
();
51
}
52
53
QString
DockWidgetViewInterface::uniqueName
()
const
54
{
55
return
m_dockWidget
->
uniqueName
();
56
}
57
58
QString
DockWidgetViewInterface::title
()
const
59
{
60
return
m_dockWidget
->
title
();
61
}
62
63
void
DockWidgetViewInterface::setTitle
(
const
QString
&title)
64
{
65
m_dockWidget
->
setTitle
(
title
);
66
}
67
68
void
DockWidgetViewInterface::setFloating
(
bool
is)
69
{
70
m_dockWidget
->
setFloating
(is);
71
}
72
73
void
DockWidgetViewInterface::setAsCurrentTab
()
74
{
75
m_dockWidget
->
setAsCurrentTab
();
76
}
77
78
bool
DockWidgetViewInterface::isOpen
()
const
79
{
80
return
m_dockWidget
->
isOpen
();
81
}
82
83
void
DockWidgetViewInterface::forceClose
()
84
{
85
m_dockWidget
->
forceClose
();
86
}
87
88
void
DockWidgetViewInterface::open
()
89
{
90
m_dockWidget
->
open
();
91
}
92
93
void
DockWidgetViewInterface::show
()
94
{
95
open
();
96
}
97
98
void
DockWidgetViewInterface::raise
()
99
{
100
m_dockWidget
->
raise
();
101
}
102
103
void
DockWidgetViewInterface::moveToSideBar
()
104
{
105
m_dockWidget
->
moveToSideBar
();
106
}
107
108
void
DockWidgetViewInterface::addDockWidgetAsTab
(
DockWidgetViewInterface
*other,
109
KDDockWidgets::InitialOption
initialOption)
110
{
111
DockWidget
*dw = other ? other->
dockWidget
() :
nullptr
;
112
m_dockWidget
->
addDockWidgetAsTab
(dw, initialOption);
113
}
114
115
void
DockWidgetViewInterface::addDockWidgetToContainingWindow
(
116
DockWidgetViewInterface
*other,
KDDockWidgets::Location
location,
117
DockWidgetViewInterface
*relativeTo,
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
124
DockWidgetOptions
DockWidgetViewInterface::options
()
const
125
{
126
return
m_dockWidget
->
options
();
127
}
128
129
void
DockWidgetViewInterface::setOptions
(DockWidgetOptions opts)
130
{
131
m_dockWidget
->
setOptions
(opts);
132
}
133
134
void
DockWidgetViewInterface::setIcon
(
const
Icon &icon, IconPlaces places)
135
{
136
m_dockWidget
->
setIcon
(
icon
, places);
137
}
138
139
Icon
DockWidgetViewInterface::icon
(
IconPlace
place)
const
140
{
141
return
m_dockWidget
->
icon
(place);
142
}
143
144
void
DockWidgetViewInterface::setAffinities
(
const
Vector<QString>
&affinities)
145
{
146
m_dockWidget
->
setAffinities
(
affinities
);
147
}
148
149
void
DockWidgetViewInterface::setAffinityName
(
const
QString
&name)
150
{
151
m_dockWidget
->
setAffinityName
(name);
152
}
153
154
Vector<QString>
DockWidgetViewInterface::affinities
()
const
155
{
156
return
m_dockWidget
->
affinities
();
157
}
158
159
}
// namespace
DockWidgetViewInterface.h
KDDockWidgets::Core::DockWidgetViewInterface
The interface that DockWidget views should implement.
Definition
DockWidgetViewInterface.h:27
KDDockWidgets::Core::DockWidgetViewInterface::forceClose
void forceClose()
Definition
DockWidgetViewInterface.cpp:83
KDDockWidgets::Core::DockWidgetViewInterface::title
QString title() const
Definition
DockWidgetViewInterface.cpp:58
KDDockWidgets::Core::DockWidgetViewInterface::show
void show()
Definition
DockWidgetViewInterface.cpp:93
KDDockWidgets::Core::DockWidgetViewInterface::raise
void raise()
Definition
DockWidgetViewInterface.cpp:98
KDDockWidgets::Core::DockWidgetViewInterface::~DockWidgetViewInterface
virtual ~DockWidgetViewInterface()
KDDockWidgets::Core::DockWidgetViewInterface::isFloating
bool isFloating() const
Definition
DockWidgetViewInterface.cpp:48
KDDockWidgets::Core::DockWidgetViewInterface::uniqueName
QString uniqueName() const
Definition
DockWidgetViewInterface.cpp:53
KDDockWidgets::Core::DockWidgetViewInterface::icon
Icon icon(IconPlace place=IconPlace::TitleBar) const
Definition
DockWidgetViewInterface.cpp:139
KDDockWidgets::Core::DockWidgetViewInterface::DockWidgetViewInterface
DockWidgetViewInterface(DockWidget *)
Definition
DockWidgetViewInterface.cpp:19
KDDockWidgets::Core::DockWidgetViewInterface::setOptions
void setOptions(DockWidgetOptions)
Definition
DockWidgetViewInterface.cpp:129
KDDockWidgets::Core::DockWidgetViewInterface::actualTitleBar
TitleBar * actualTitleBar() const
Definition
DockWidgetViewInterface.cpp:34
KDDockWidgets::Core::DockWidgetViewInterface::isFocused
bool isFocused() const
Definition
DockWidgetViewInterface.cpp:43
KDDockWidgets::Core::DockWidgetViewInterface::open
void open()
Definition
DockWidgetViewInterface.cpp:88
KDDockWidgets::Core::DockWidgetViewInterface::moveToSideBar
void moveToSideBar()
Definition
DockWidgetViewInterface.cpp:103
KDDockWidgets::Core::DockWidgetViewInterface::addDockWidgetAsTab
void addDockWidgetAsTab(DockWidgetViewInterface *other, KDDockWidgets::InitialOption initialOption={})
Definition
DockWidgetViewInterface.cpp:108
KDDockWidgets::Core::DockWidgetViewInterface::setIcon
void setIcon(const Icon &icon, IconPlaces places=IconPlace::All)
Definition
DockWidgetViewInterface.cpp:134
KDDockWidgets::Core::DockWidgetViewInterface::addDockWidgetToContainingWindow
void addDockWidgetToContainingWindow(DockWidgetViewInterface *other, KDDockWidgets::Location location, DockWidgetViewInterface *relativeTo=nullptr, KDDockWidgets::InitialOption initialOption={})
Definition
DockWidgetViewInterface.cpp:115
KDDockWidgets::Core::DockWidgetViewInterface::isOpen
bool isOpen() const
Definition
DockWidgetViewInterface.cpp:78
KDDockWidgets::Core::DockWidgetViewInterface::setAsCurrentTab
void setAsCurrentTab()
Definition
DockWidgetViewInterface.cpp:73
KDDockWidgets::Core::DockWidgetViewInterface::options
DockWidgetOptions options() const
Definition
DockWidgetViewInterface.cpp:124
KDDockWidgets::Core::DockWidgetViewInterface::setAffinityName
void setAffinityName(const QString &name)
Definition
DockWidgetViewInterface.cpp:149
KDDockWidgets::Core::DockWidgetViewInterface::setAffinities
void setAffinities(const Vector< QString > &)
Definition
DockWidgetViewInterface.cpp:144
KDDockWidgets::Core::DockWidgetViewInterface::dockWidget
DockWidget * dockWidget() const
Definition
DockWidgetViewInterface.cpp:29
KDDockWidgets::Core::DockWidgetViewInterface::setTitle
void setTitle(const QString &)
Definition
DockWidgetViewInterface.cpp:63
KDDockWidgets::Core::DockWidgetViewInterface::affinities
Vector< QString > affinities() const
Definition
DockWidgetViewInterface.cpp:154
KDDockWidgets::Core::DockWidgetViewInterface::m_dockWidget
DockWidget *const m_dockWidget
Definition
DockWidgetViewInterface.h:72
KDDockWidgets::Core::DockWidgetViewInterface::setFloating
void setFloating(bool)
Definition
DockWidgetViewInterface.cpp:68
KDDockWidgets::Core::DockWidgetViewInterface::group
Group * group() const
Definition
DockWidgetViewInterface.cpp:24
KDDockWidgets::Core::DockWidget
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
Definition
core/DockWidget.h:60
KDDockWidgets::Core::DockWidget::setFloating
bool setFloating(bool floats)
setter to make the dock widget float or dock.
Definition
core/DockWidget.cpp:208
KDDockWidgets::Core::DockWidget::setAsCurrentTab
void setAsCurrentTab()
Makes this dock widget current in its tab group.
Definition
core/DockWidget.cpp:351
KDDockWidgets::Core::DockWidget::setTitle
void setTitle(const QString &title)
setter for the dock widget's title
Definition
core/DockWidget.cpp:287
KDDockWidgets::Core::DockWidget::addDockWidgetToContainingWindow
void addDockWidgetToContainingWindow(KDDockWidgets::Core::DockWidget *other, KDDockWidgets::Location location, KDDockWidgets::Core::DockWidget *relativeTo=nullptr, KDDockWidgets::InitialOption initialOption={})
docks other widget into the window that contains this one. Equivalent to MainWindow::addDockWidget() ...
Definition
core/DockWidget.cpp:143
KDDockWidgets::Core::DockWidget::uniqueName
QString uniqueName() const
the dock widget's unique name.
Definition
core/DockWidget.cpp:265
KDDockWidgets::Core::DockWidget::addDockWidgetAsTab
void addDockWidgetAsTab(KDDockWidgets::Core::DockWidget *other, KDDockWidgets::InitialOption initialOption={})
docks other widget into this one. Tabs will be shown if not already.
Definition
core/DockWidget.cpp:88
KDDockWidgets::Core::DockWidget::setOptions
void setOptions(DockWidgetOptions)
Setter for the options. Only DockWidetOption_NotClosable is allowed to change after construction....
Definition
core/DockWidget.cpp:315
KDDockWidgets::Core::DockWidget::affinities
Vector< QString > affinities() const
Returns the affinity name. Empty by default.
Definition
core/DockWidget.cpp:419
KDDockWidgets::Core::DockWidget::isOpen
bool isOpen() const
Returns whether this dock widget is open. Equivalent to calling toggleAction().isChecked()
Definition
core/DockWidget.cpp:414
KDDockWidgets::Core::DockWidget::icon
Icon icon(IconPlace place=IconPlace::TitleBar) const
Returns the dock widget's titlebar, tabbar, or toggle action icon (depending on the passed place)
Definition
core/DockWidget.cpp:387
KDDockWidgets::Core::DockWidget::setIcon
void setIcon(const Icon &icon, IconPlaces places=IconPlace::All)
Sets an icon to show on title bars and tab bars.
Definition
core/DockWidget.cpp:373
KDDockWidgets::Core::DockWidget::open
void open()
Opens this dock widget. Does nothing if already open. The dock widget will appear floating unless it ...
Definition
core/DockWidget.cpp:429
KDDockWidgets::Core::DockWidget::isFocused
bool isFocused() const
Returns whether This or any child of this dock widget is focused Not to be confused with QWidget::has...
Definition
core/DockWidget.cpp:474
KDDockWidgets::Core::DockWidget::title
QString title() const
Returns the dock widget's title. This title is visible in title bars and tab bars.
Definition
core/DockWidget.cpp:270
KDDockWidgets::Core::DockWidget::moveToSideBar
void moveToSideBar()
Minimizes this dock widget to the MainWindow's side-bar.
Definition
core/DockWidget.cpp:502
KDDockWidgets::Core::DockWidget::isFloating
bool isFloating() const
Returns whether the dock widget is floating. Floating means it's not docked and has a window of its o...
Definition
core/DockWidget.cpp:199
KDDockWidgets::Core::DockWidget::dptr
Private * dptr() const
Definition
core/DockWidget.cpp:678
KDDockWidgets::Core::DockWidget::raise
void raise()
Brings the dock widget to the front.
Definition
core/DockWidget.cpp:441
KDDockWidgets::Core::DockWidget::setAffinities
void setAffinities(const Vector< QString > &)
Sets the affinity names. Dock widgets can only dock into dock widgets of the same affinity.
Definition
core/DockWidget.cpp:485
KDDockWidgets::Core::DockWidget::options
DockWidgetOptions options() const
Returns the dock widget's options which control behaviour.
Definition
core/DockWidget.cpp:305
KDDockWidgets::Core::DockWidget::forceClose
void forceClose()
Like QWidget::close() but the hosted widget won't be asked if we should close.
Definition
core/DockWidget.cpp:401
KDDockWidgets::Core::DockWidget::setAffinityName
void setAffinityName(const QString &name)
Definition
core/DockWidget.cpp:480
KDDockWidgets::Core::Group
Definition
core/Group.h:41
KDDockWidgets::Core::Group::actualTitleBar
Core::TitleBar * actualTitleBar() const
Definition
core/Group.cpp:486
KDDockWidgets::Core::TitleBar
Definition
core/TitleBar.h:32
KDDockWidgets::Core
Definition
Config.h:27
KDDockWidgets::Location
Location
Definition
KDDockWidgets.h:64
KDDockWidgets::IconPlace
IconPlace
Definition
KDDockWidgets.h:112
QString
KDDockWidgets::InitialOption
Struct describing the preferred dock widget size and visibility when adding it to a layout.
Definition
KDDockWidgets.h:168
KDToolBox::StlContainerAdaptor::StdVectorAdaptor
Definition
KDStlContainerAdaptor.h:43
© 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