KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Layout.h
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
22#ifndef KDDOCKWIDGETS_LAYOUT_P_H
23#define KDDOCKWIDGETS_LAYOUT_P_H
24
25#pragma once
26
27#include "kddockwidgets/core/View.h"
28#include "kddockwidgets/docks_export.h"
29#include "kddockwidgets/KDDockWidgets.h"
30#include "kddockwidgets/LayoutSaver.h"
31#include "kddockwidgets/QtCompat_p.h"
32
33namespace KDDockWidgets {
34
35namespace Core {
36class LayoutingHost;
37class Group;
38class FloatingWindow;
39class DockWidget;
40class MainWindow;
41class Item;
42class ItemContainer;
43class Separator;
44
56class DOCKS_EXPORT Layout : public Controller
57{
58 Q_OBJECT
59public:
60 explicit Layout(ViewType, View *);
61 ~Layout();
62
66 bool isInMainWindow(bool honourNesting = false) const;
67
68 Core::MainWindow *mainWindow(bool honourNesting = false) const;
69
70 Core::FloatingWindow *floatingWindow() const;
71
76 Size layoutMinimumSize() const;
77
81 Size layoutMaximumSizeHint() const;
82
87 int layoutWidth() const
88 {
89 return layoutSize().width();
90 }
91
96 int layoutHeight() const
97 {
98 return layoutSize().height();
99 }
100
104 Size layoutSize() const;
105
107 bool checkSanity() const;
108
110 void clearLayout();
111
113 void dumpLayout() const;
114
121 void setLayoutSize(Size);
122
123
125 void restorePlaceholder(Core::DockWidget *dw, Core::Item *, int tabIndex);
126
130 Vector<Core::Item *> items() const;
131
135 bool containsItem(const Core::Item *) const;
136
140 bool containsGroup(const Core::Group *) const;
141
147 int count() const;
148
154 int visibleCount() const;
155
161 int placeholderCount() const;
162
166 Core::Item *itemForGroup(const Core::Group *group) const;
167
171 Vector<Core::Group *> groups() const;
172
174 Vector<Core::DockWidget *> dockWidgets() const;
175
179 void removeItem(Core::Item *item);
180
184 void updateSizeConstraints();
185
186 virtual bool deserialize(const LayoutSaver::MultiSplitter &);
187 LayoutSaver::MultiSplitter serialize() const;
188
189 Core::DropArea *asDropArea() const;
190 Core::MDILayout *asMDILayout() const;
191
192 void viewAboutToBeDeleted();
193
194 Core::ItemContainer *rootItem() const;
195
196 void onCloseEvent(CloseEvent *);
197
198 LayoutingHost *asLayoutingHost() const;
199 static Layout *fromLayoutingHost(LayoutingHost *);
200
201 class Private;
202 Layout::Private *d_ptr();
203
204protected:
205 void setRootItem(Core::ItemContainer *root);
210 void setLayoutMinimumSize(Size);
211
221 void unrefOldPlaceholders(const Vector<Core::Group *> &groupsBeingAdded) const;
222
228 Vector<Core::Group *> groupsFrom(View *groupOrMultiSplitter) const;
229
230private:
231 Private *const d;
232 bool onResize(Size newSize);
233};
234
235}
236
237}
238
239#endif
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The widget (QWidget or QQuickItem) which holds a layout of dock widgets.
Definition Layout.h:57
int layoutHeight() const
returns the contents height. Usually it's the same height as the respective parent MultiSplitter.
Definition Layout.h:96
int layoutWidth() const
returns the contents width. Usually it's the same width as the respective parent MultiSplitter.
Definition Layout.h:87
The MDILayout class implements a layout suitable for MDI style docking. Where dock widgets are free t...
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
ViewType
Each View type also has a specific Controller associated with, except for ViewType::None.
Definition Controller.h:26
Class to abstract QAction, so code still works with QtQuick and Flutter.

© 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