KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
qtwidgets/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#ifndef KDDOCKWIDGETS_PLATFORM_QTWIDGETS_H
13#define KDDOCKWIDGETS_PLATFORM_QTWIDGETS_H
14#pragma once
15
16#include "kddockwidgets/qtcommon/Platform.h"
17
18namespace KDDockWidgets {
19
20namespace Core {
21class MainWindow;
22}
23
24namespace QtWidgets {
25
28class DOCKS_EXPORT Platform : public QtCommon::Platform_qt
29{
30public:
31 Platform();
32 ~Platform() override;
33 const char *name() const override;
34 bool hasActivePopup() const override;
35 std::shared_ptr<Core::View> qobjectAsView(QObject *) const override;
36 std::shared_ptr<Core::Window> windowFromQWindow(QWindow *) const override;
37 Core::ViewFactory *createDefaultViewFactory() override;
38 std::shared_ptr<Core::Window> windowAt(QPoint globalPos) const override;
39
40 using Platform_qt::screenNumberFor;
41 int screenNumberFor(Core::View *) const override;
42 QSize screenSizeFor(Core::View *) const override;
43
44 int startDragDistance_impl() const override;
45 Core::View *createView(Core::Controller *controller, Core::View *parent = nullptr) const override;
46 bool inDisallowedDragView(QPoint globalPos) const override;
47 bool usesFallbackMouseGrabber() const override;
48 void ungrabMouse() override;
49
50#ifdef DOCKS_TESTING_METHODS
51 explicit Platform(int &argc, char **argv);
52 void tests_initPlatform_impl() override;
53 void tests_deinitPlatform_impl() override;
54 Core::View *tests_createView(Core::CreateViewOptions, Core::View *parent = nullptr) override;
55 Core::View *tests_createFocusableView(Core::CreateViewOptions, Core::View *parent = nullptr) override;
56 Core::View *tests_createNonClosableView(Core::View *parent = nullptr) override;
57 std::shared_ptr<Core::Window> tests_createWindow() override;
59 createMainWindow(const QString &uniqueName, Core::CreateViewOptions,
60 MainWindowOptions options = MainWindowOption_HasCentralFrame,
61 Core::View *parent = nullptr, Qt::WindowFlags = {}) const override;
62#endif
63protected:
64 void init();
65 class GlobalEventFilter;
66 GlobalEventFilter *const m_globalEventFilter;
67};
68}
69
70}
71
72#endif
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
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,...
GlobalEventFilter *const m_globalEventFilter
Class to abstract QAction, so code still works with QtQuick and Flutter.
@ MainWindowOption_HasCentralFrame
‍No option set
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