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,
30 TitleBar = 2,
31 TabBar = 4,
32 Stack = 8,
33 FloatingWindow = 16,
34 Separator = 32,
35 DockWidget = 64,
36 LayoutItem = 256,
37 SideBar = 512,
38 MainWindow = 1024,
39 ViewWrapper = 2048,
40 DropArea = 4096,
41 MDILayout = 8192,
42 RubberBand = 0x4000,
44
45 LAST = RubberBand // Keep last
46};
47
48class DOCKS_EXPORT Controller : public Object
49{
50 Q_OBJECT
51public:
52 explicit Controller(ViewType type, View *);
53 virtual ~Controller();
54
56 View *view() const;
57
59 ViewType type() const;
60
62 bool is(ViewType) const;
63
66 bool isVisible() const;
67
70 void setVisible(bool);
71
72 Rect rect() const;
73 Point mapToGlobal(Point) const;
74 int height() const;
75 int width() const;
76 Size size() const;
77 Point pos() const;
78 Rect geometry() const;
79 int x() const;
80 int y() const;
81 bool close();
82 std::shared_ptr<View> window() const;
83 void show() const;
84 bool inDtor() const;
85
88 void setParentView(View *parent);
89
92 void destroyLater();
93
94 class Private;
95 Controller::Private *dptr() const;
96
97protected:
98 virtual void setParentView_impl(View *parent);
99 bool m_inDtor = false;
100
101private:
102 Private *const d;
103};
104
105}
106
107}
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