Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qcocoaintegration.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPLATFORMINTEGRATION_COCOA_H
5#define QPLATFORMINTEGRATION_COCOA_H
6
7#include "qcocoacursor.h"
8#include "qcocoawindow.h"
10#include "qcocoainputcontext.h"
11#include "qcocoaaccessibility.h"
12#include "qcocoaclipboard.h"
13#include "qcocoadrag.h"
14#include "qcocoaservices.h"
15#if QT_CONFIG(vulkan)
17#endif
18#include "qcocoawindowmanager.h"
19
20#include <QtCore/QScopedPointer>
21#include <qpa/qplatformintegration.h>
22#include <QtGui/private/qcoretextfontdatabase_p.h>
23#ifndef QT_NO_OPENGL
24# include <QtGui/private/qopenglcontext_p.h>
25#endif
26#include <QtGui/private/qapplekeymapper_p.h>
27
29
31
33#ifndef QT_NO_OPENGL
34 , public QNativeInterface::Private::QCocoaGLIntegration
35#endif
36{
38public:
39 enum Option {
41 };
43
44 QCocoaIntegration(const QStringList &paramList);
46
48 Options options() const;
49
52 QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
54#ifndef QT_NO_OPENGL
56 QOpenGLContext *createOpenGLContext(NSOpenGLContext *, QOpenGLContext *shareContext) const override;
57#endif
59
61
62#if QT_CONFIG(vulkan)
63 QPlatformVulkanInstance *createPlatformVulkanInstance(QVulkanInstance *instance) const override;
64 QCocoaVulkanInstance *getCocoaVulkanInstance() const;
65#endif
66
67#if QT_CONFIG(sessionmanager)
69#endif
70
71 QCoreTextFontDatabase *fontDatabase() const override;
72 QCocoaNativeInterface *nativeInterface() const override;
73 QPlatformInputContext *inputContext() const override;
74#if QT_CONFIG(accessibility)
75 QCocoaAccessibility *accessibility() const override;
76#endif
77#ifndef QT_NO_CLIPBOARD
78 QCocoaClipboard *clipboard() const override;
79#endif
80 QCocoaDrag *drag() const override;
81
82 QStringList themeNames() const override;
83 QPlatformTheme *createPlatformTheme(const QString &name) const override;
84 QCocoaServices *services() const override;
85 QVariant styleHint(StyleHint hint) const override;
86
87 Qt::KeyboardModifiers queryKeyboardModifiers() const override;
88 QList<int> possibleKeys(const QKeyEvent *event) const override;
89
90 void setApplicationIcon(const QIcon &icon) const override;
91 void setApplicationBadge(qint64 number) override;
92
93 void beep() const override;
94 void quit() const override;
95
96private Q_SLOTS:
97 void focusWindowChanged(QWindow *);
98
99private:
100 static QCocoaIntegration *mInstance;
101 Options mOptions;
102
104
106#if QT_CONFIG(accessibility)
108#endif
109 QScopedPointer<QPlatformTheme> mPlatformTheme;
110#ifndef QT_NO_CLIPBOARD
111 QCocoaClipboard *mCocoaClipboard;
112#endif
116 QScopedPointer<QAppleKeyMapper> mKeyboardMapper;
117
118#if QT_CONFIG(vulkan)
119 mutable QCocoaVulkanInstance *mCocoaVulkanInstance = nullptr;
120#endif
121
122 QCocoaWindowManager m_windowManager;
123};
124
125Q_DECLARE_OPERATORS_FOR_FLAGS(QCocoaIntegration::Options)
126
128
129#endif
130
QPlatformWindow * createForeignWindow(QWindow *window, WId nativeHandle) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *widget) const override
Factory function for QPlatformBackingStore.
QVariant styleHint(StyleHint hint) const override
QList< int > possibleKeys(const QKeyEvent *event) const override
Should be used to obtain a list of possible shortcuts for the given key event.
static QCocoaIntegration * instance()
bool hasCapability(QPlatformIntegration::Capability cap) const override
void setApplicationIcon(const QIcon &icon) const override
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
Factory function for QPlatformOpenGLContext.
QCocoaClipboard * clipboard() const override
Accessor for the platform integration's clipboard.
QCocoaServices * services() const override
QCocoaDrag * drag() const override
void quit() const override
void setApplicationBadge(qint64 number) override
Options options() const
Qt::KeyboardModifiers queryKeyboardModifiers() const override
QOpenGLContext * createOpenGLContext(NSOpenGLContext *, QOpenGLContext *shareContext) const override
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
Factory function for QOffscreenSurface.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
void beep() const override
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QPlatformTheme * createPlatformTheme(const QString &name) const override
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QCocoaNativeInterface * nativeInterface() const override
QStringList themeNames() const override
QCoreTextFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QKeyEvent class describes a key event.
Definition qevent.h:423
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
\inmodule QtGui
\inmodule QtGui
The QPlatformBackingStore class provides the drawing area for top-level windows.
The QPlatformInputContext class abstracts the input method dependent data and composing state.
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
virtual QPlatformSessionManager * createPlatformSessionManager(const QString &id, const QString &key) const
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformTheme class allows customizing the UI based on themes.
The QPlatformVulkanInstance class provides an abstraction for Vulkan instances.
The QPlatformWindow class provides an abstraction for top-level windows.
\inmodule QtCore
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qvariant.h:64
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
QOpenGLWidget * widget
[1]
Combined button and popup list for selecting options.
static void * context
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLuint64 key
GLuint name
struct _cl_event * event
GLenum cap
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_OBJECT
#define Q_SLOTS
long long qint64
Definition qtypes.h:55
aWidget window() -> setWindowTitle("New Window Title")
[2]