KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
qtwidgets/views/DockWidget.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_DOCKWIDGET_WIDGETS_H
20#define KD_DOCKWIDGET_WIDGETS_H
21#pragma once
22
23#include "kddockwidgets/core/views/DockWidgetViewInterface.h"
24#include "View.h"
25
26// clazy:excludeall=ctor-missing-parent-argument
27
28namespace KDDockWidgets {
29
30namespace QtWidgets {
31
37#ifdef PYTHON_BINDINGS
38class DOCKS_EXPORT DockWidget : public QWidget,
39 public Core::DockWidgetViewInterface
40#else
41class DOCKS_EXPORT DockWidget : public QtWidgets::View<QWidget>,
43#endif
44{
45 Q_OBJECT
46public:
47 using QWidget::size;
48
60 explicit DockWidget(const QString &uniqueName, DockWidgetOptions options = {},
61 LayoutSaverOptions layoutSaverOptions = {},
62 Qt::WindowFlags windowFlags = Qt::Tool);
63
65 ~DockWidget() override;
66
76 void setWidget(QWidget *widget);
77
79 QWidget *widget() const;
80
81 QAction *toggleAction() const;
82 QAction *floatAction() const;
83
84#ifndef PYTHON_BINDINGS
85 // Override QWidget::show() as there's more to do.
86 void show() override
87 {
88 Core::DockWidgetViewInterface::open();
89 }
90
91 // Override QWidget::raise() as there's more to do, like setting it as current tab
92 // if it's tabbed
93 void raise() override
94 {
95 Core::DockWidgetViewInterface::raise();
96 }
97#endif
98
99Q_SIGNALS:
100 void optionsChanged(KDDockWidgets::DockWidgetOptions);
104 void isOpenChanged(bool);
106
110
111protected:
112 bool event(QEvent *) override;
113 void mouseDoubleClickEvent(QMouseEvent *ev) override;
114 void resizeEvent(QResizeEvent *) override;
115 std::shared_ptr<Core::View> focusCandidate() const override;
116
117private:
118 class Private;
119 Private *const d;
120};
121
122}
123
124}
125
126#endif
The interface that DockWidget views should implement.
void isCurrentTabChanged(bool)
Emitted when a dock widget becomes current or not in its tab group.
void optionsChanged(KDDockWidgets::DockWidgetOptions)
Class to abstract QAction, so code still works with QtQuick and Flutter.
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