KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
qtwidgets/views/MainWindow.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 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
19#ifndef KD_MAINWINDOW_H
20#define KD_MAINWINDOW_H
21
22#include "View.h"
23#include "kddockwidgets/core/views/MainWindowViewInterface.h"
24
25#include <QMainWindow>
26
27QT_BEGIN_NAMESPACE
28class QHBoxLayout;
29QT_END_NAMESPACE
30
31namespace KDDockWidgets {
32
33namespace Core {
34class MainWindow;
35class SideBar;
36}
37
38namespace QtWidgets {
39
44#ifdef PYTHON_BINDINGS
45class DOCKS_EXPORT MainWindow : public QMainWindow,
46 public Core::MainWindowViewInterface
47#else
48class DOCKS_EXPORT MainWindow : public View<QMainWindow>,
50#endif
51{
52 Q_OBJECT
53public:
54 using MainWindowViewInterface::addDockWidget; // don't consider QMainWindow's one
55 using QWidget::size;
56
63 explicit MainWindow(const QString &uniqueName, MainWindowOptions options = {},
64 QWidget *parent = nullptr,
66
67
69 ~MainWindow() override;
70
72 QMargins centerWidgetMargins() const override;
73
76
78 void setContentsMargins(int left, int top, int right, int bottom) override;
79
82
87
90
91protected:
92 QRect centralAreaGeometry() const override;
93
94private:
95 friend class Core::MainWindow;
97 void setCentralWidget(QWidget *); // overridden just to make it private
98
99 class Private;
100 Private *const d;
101};
102}
103}
104
105#endif
The interface that MainWindow views should implement.
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
The QMainwindow sub-class that the application should use to be able to dock KDDockWidget DockWidget ...
MainWindow(const QString &uniqueName, MainWindowOptions options={}, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructor. Use it as you would use QMainWindow.
void setPersistentCentralWidget(QWidget *widget)
QHBoxLayout * internalLayout() const
returns the internal layout this is rarely needed unless you want to layout other widgets next to the...
void setContentsMargins(int left, int top, int right, int bottom) override
Sets the main window's content margins.
~MainWindow() override
Destructor.
QWidget * persistentCentralWidget() const
void setCenterWidgetMargins(QMargins)
sets the margins for the contents widget
QMargins centerWidgetMargins() const override
returns the margins for the contents widget
void updateMargins()
for internal use only
QRect centralAreaGeometry() const override
Class to abstract QAction, so code still works with QtQuick and Flutter.
void setCentralWidget(QWidget *widget)
typedef WindowFlags

© 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