KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
flutter/views/DockWidget.cpp
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
12#include "DockWidget.h"
13#include "core/ViewFactory.h"
14
15#include "kddockwidgets/core/TitleBar.h"
16#include "kddockwidgets/core/DockWidget.h"
17#include "core/DockWidget_p.h"
18#include "core/Logging_p.h"
19#include "kddockwidgets/core/Group.h"
20#include "flutter/Platform.h"
22#include "flutter/views/Group.h"
23#include "flutter/ViewFactory.h"
24#include "flutter/views/ViewWrapper_p.h"
25
26#include <Config.h>
27
35using namespace KDDockWidgets;
36using namespace KDDockWidgets::flutter;
37
38
39DockWidget::DockWidget(const QString &uniqueName, DockWidgetOptions options,
40 LayoutSaverOptions layoutSaverOptions)
41 : View(new Core::DockWidget(this, uniqueName, options, layoutSaverOptions), Core::ViewType::DockWidget,
42 nullptr)
43 , Core::DockWidgetViewInterface(asDockWidgetController())
44{
45 init();
47
48 m_dockWidget->dptr()->guestViewChanged.connect([this] {
49 if (auto guest = m_dockWidget->guestView()) {
50 guest->setVisible(true);
51 }
52 });
53}
54
58
60{
61}
62
64{
65 if (auto guestWidget = dockWidget()->guestView()) {
66 // The guests min-size is the same as the widget's, there's no spacing or margins.
67 return guestWidget->minSize();
68 }
69
70 return View::minSize();
71}
72
74{
75 if (auto guestWidget = dockWidget()->guestView()) {
76 // The guests max-size is the same as the widget's, there's no spacing or margins.
77 return guestWidget->maxSizeHint();
78 }
79
80 return View::maxSizeHint();
81}
82
87
88std::shared_ptr<Core::View> DockWidget::focusCandidate() const
89{
90 return ViewWrapper::create(const_cast<flutter::DockWidget *>(this));
91}
Application-wide config to tune certain behaviours of the framework.
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
std::shared_ptr< View > guestView() const
Like widget() but returns a view.
std::shared_ptr< Core::View > focusCandidate() const override
Size minSize() const override
Reimplemented for internal purposes. .
Size maxSizeHint() const override
Reimplemented for internal purposes. .
DockWidget(const QString &uniqueName, DockWidgetOptions options={}, LayoutSaverOptions layoutSaverOptions={})
constructs a new DockWidget
A factory class for allowing the user to customize some internal widgets.
Class to abstract QAction, so code still works with QtQuick and Flutter.
Represents a dock widget.

© 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