KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
qtquick/Platform.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/KDDockWidgets.h"
15#include "kddockwidgets/qtcommon/Platform.h"
16
17#include <QPointer>
18
19QT_BEGIN_NAMESPACE
20class QQmlEngine;
21class QQuickItem;
22QT_END_NAMESPACE
23
24namespace KDDockWidgets {
25
26class QtQuickHelpers;
27
28namespace Core {
29class DockWidget;
30}
31
32namespace QtQuick {
33
34class ViewFactory;
35
38class DOCKS_EXPORT Platform : public QtCommon::Platform_qt
39{
40public:
41 Platform();
42 ~Platform() override;
43 const char *name() const override;
44 std::shared_ptr<Core::View> qobjectAsView(QObject *) const override;
45 std::shared_ptr<Core::Window> windowFromQWindow(QWindow *) const override;
46 Core::ViewFactory *createDefaultViewFactory() override;
47 QtQuick::ViewFactory *viewFactory() const;
48 std::shared_ptr<Core::Window> windowAt(QPoint globalPos) const override;
49 int screenNumberForView(Core::View *) const override;
50 QSize screenSizeFor(Core::View *) const override;
51 void setQmlEngine(QQmlEngine *);
52 QQmlEngine *qmlEngine() const;
53 Core::View *createView(Core::Controller *controller, Core::View *parent = nullptr) const override;
54 bool usesFallbackMouseGrabber() const override;
55 bool inDisallowedDragView(QPoint globalPos) const override;
56 void ungrabMouse() override;
57 static Platform *instance();
58
59 static Core::DockWidget *dockWidgetForItem(QQuickItem *);
60
61#ifdef DOCKS_TESTING_METHODS
62 explicit Platform(int &argc, char **argv, bool defaultToOffscreenQPA);
63 void tests_initPlatform_impl() override;
64 void tests_deinitPlatform_impl() override;
65 Core::View *tests_createView(Core::CreateViewOptions, Core::View *parent = nullptr) override;
66 std::shared_ptr<Core::Window> tests_createWindow() override;
67 Core::View *tests_createFocusableView(Core::CreateViewOptions, Core::View *parent = nullptr) override;
68 Core::View *tests_createNonClosableView(Core::View *parent = nullptr) override;
70 createMainWindow(const QString &uniqueName, Core::CreateViewOptions,
71 MainWindowOptions options = MainWindowOption_HasCentralFrame,
72 Core::View *parent = nullptr, Qt::WindowFlags = {}) const override;
73#endif
74private:
75 void init();
76 QPointer<QQmlEngine> m_qmlEngine;
77 QtQuickHelpers *const m_qquickHelpers;
78 Q_DISABLE_COPY(Platform)
79};
80
81}
82
84{
85 return static_cast<QtQuick::Platform *>(Core::Platform::instance());
86}
87
88}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
static Platform * instance()
Returns the platform singleton.
A factory class for allowing the user to customize some internal views. This is optional,...
Baseclass platform for Qt based platform Useful since QtWidgets and QtQuick share some similarities.
implements functions specific to a particular platform A platform can be for example qtwidgets,...
The default ViewFactory for QtQuick frontend.
Class to abstract QAction, so code still works with QtQuick and Flutter.
@ MainWindowOption_HasCentralFrame
‍No option set
QtQuick::Platform * plat()
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