KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Controller.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
12#pragma once
13
14#include "kddockwidgets/docks_export.h"
15#include "kddockwidgets/QtCompat_p.h"
16
17#include <memory>
18
19namespace KDDockWidgets {
20
21namespace Core {
22
23class View;
24
26enum class ViewType {
27 FIRST = 1, // Keep first
28 None = 0,
29 Frame = 1, // deprecated name
30 Group = 1,
31 TitleBar = 2,
32 TabBar = 4,
33 Stack = 8,
34 FloatingWindow = 16,
35 Separator = 32,
36 DockWidget = 64,
37 LayoutItem = 256,
38 SideBar = 512,
39 MainWindow = 1024,
40 ViewWrapper = 2048,
41 DropArea = 4096,
42 MDILayout = 8192,
43 RubberBand = 0x4000,
45
46 LAST = RubberBand // Keep last
47};
48
49class DOCKS_EXPORT Controller : public Object
50{
51 Q_OBJECT
52public:
53 explicit Controller(ViewType type, View *);
54 virtual ~Controller();
55
57 View *view() const;
58
60 ViewType type() const;
61
63 bool is(ViewType) const;
64
67 bool isVisible() const;
68
71 void setVisible(bool);
72
73 Rect rect() const;
74 Point mapToGlobal(Point) const;
75 int height() const;
76 int width() const;
77 Size size() const;
78 Point pos() const;
79 Rect geometry() const;
80 int x() const;
81 int y() const;
82 bool close();
83 std::shared_ptr<View> window() const;
84 void show() const;
85 bool inDtor() const;
86
89 void setParentView(View *parent);
90
93 void destroyLater();
94
95 bool isFixedHeight() const;
96 bool isFixedWidth() const;
97
98 class Private;
99 Controller::Private *dptr() const;
100
101protected:
102 virtual void setParentView_impl(View *parent);
103 bool m_inDtor = false;
104
105private:
106 Private *const d;
107};
108
109}
110
111}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
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