KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
MainWindowViewInterface.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/KDDockWidgets.h"
16
17namespace KDDockWidgets {
18
19namespace Core {
20
21class SideBar;
22class MainWindow;
23class DockWidgetViewInterface;
24
26class DOCKS_EXPORT MainWindowViewInterface
27{
28public:
31 virtual Margins centerWidgetMargins() const = 0;
32 virtual Rect centralAreaGeometry() const = 0;
33 virtual void setContentsMargins(int left, int top, int right, int bottom) = 0;
34
36 MainWindow *mainWindow() const;
37
38
39 // controllers/MainWindow.h public interface:
40 QString uniqueName() const;
41 Vector<QString> affinities() const;
42 void setAffinities(const Vector<QString> &names);
43 MainWindowOptions options() const;
44 bool isMDI() const;
45 bool closeDockWidgets(bool force = false);
46 bool sideBarIsVisible(KDDockWidgets::SideBarLocation) const;
47 void clearSideBarOverlay(bool deleteFrame = true);
48 void layoutEqually();
49 bool anySideBarIsVisible() const;
50
51 void addDockWidgetAsTab(DockWidgetViewInterface *dockwidget);
52 void addDockWidget(DockWidgetViewInterface *dockWidget, KDDockWidgets::Location location,
53 DockWidgetViewInterface *relativeTo = nullptr,
54 KDDockWidgets::InitialOption initialOption = {});
55
56 void moveToSideBar(DockWidgetViewInterface *);
58 void restoreFromSideBar(DockWidgetViewInterface *);
59 void overlayOnSideBar(DockWidgetViewInterface *);
60 void toggleOverlayOnSideBar(DockWidgetViewInterface *);
61 void layoutParentContainerEqually(DockWidgetViewInterface *);
62
63 void moveToSideBar(const QString &dockId);
64 void moveToSideBar(const QString &dockId, KDDockWidgets::SideBarLocation);
65 void restoreFromSideBar(const QString &dockId);
66 void overlayOnSideBar(const QString &dockId);
67 void toggleOverlayOnSideBar(const QString &dockId);
68 void layoutParentContainerEqually(const QString &dockId);
69 void addDockWidgetAsTab(const QString &dockId);
70 void addDockWidget(const QString &dockId, KDDockWidgets::Location,
71 const QString &relativeToDockId = {}, KDDockWidgets::InitialOption = {});
72
73protected:
77};
78
79}
80
81}
The interface that DockWidget views should implement.
The interface that MainWindow views should implement.
MainWindowViewInterface & operator=(const MainWindowViewInterface &)=delete
MainWindowViewInterface(const MainWindowViewInterface &)=delete
virtual Margins centerWidgetMargins() const =0
virtual void setContentsMargins(int left, int top, int right, int bottom)=0
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
Class to abstract QAction, so code still works with QtQuick and Flutter.
SideBarLocation
Each main window supports 4 sidebars.
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