Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qminimaleglintegration.cpp
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
5
6#include "qminimaleglwindow.h"
7#ifndef QT_NO_OPENGL
9#endif
10#include <QtGui/private/qgenericunixfontdatabase_p.h>
11
12#if defined(Q_OS_UNIX)
13# include <QtGui/private/qgenericunixeventdispatcher_p.h>
14#elif defined(Q_OS_WIN)
15# include <QtGui/private/qwindowsguieventdispatcher_p.h>
16#endif
17
18#include <qpa/qplatformwindow.h>
19#include <QtGui/QSurfaceFormat>
20#include <QtGui/QOpenGLContext>
21#include <QtGui/QScreen>
22#include <qpa/qwindowsysteminterface.h>
23
24// this is where EGL headers are pulled in, make sure it is last
25#include "qminimaleglscreen.h"
26
28
30 : mFontDb(new QGenericUnixFontDatabase()), mScreen(new QMinimalEglScreen(EGL_DEFAULT_DISPLAY))
31{
33
34#ifdef QEGL_EXTRA_DEBUG
35 qWarning("QMinimalEglIntegration\n");
36#endif
37}
38
44
46{
47 switch (cap) {
48 case ThreadedPixmaps: return true;
49 case OpenGL: return true;
50 case ThreadedOpenGL: return true;
52 }
53}
54
56{
57#ifdef QEGL_EXTRA_DEBUG
58 qWarning("QMinimalEglIntegration::createPlatformWindow %p\n",window);
59#endif
61 w->requestActivateWindow();
62 return w;
63}
64
65
67{
68#ifdef QEGL_EXTRA_DEBUG
69 qWarning("QMinimalEglIntegration::createWindowSurface %p\n", window);
70#endif
71#ifndef QT_NO_OPENGL
73#else
75 return nullptr;
76#endif
77}
78#ifndef QT_NO_OPENGL
80{
81 return static_cast<QMinimalEglScreen *>(context->screen()->handle())->platformContext();
82}
83#endif
84
89
91{
92#if defined(Q_OS_UNIX)
93 return createUnixEventDispatcher();
94#elif defined(Q_OS_WIN)
96#else
97 return nullptr;
98#endif
99}
100
108
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
Factory function for QPlatformOpenGLContext.
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QVariant styleHint(QPlatformIntegration::StyleHint hint) const override
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
\inmodule QtGui
The QPlatformBackingStore class provides the drawing area for top-level windows.
The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they ...
virtual QVariant styleHint(StyleHint hint) const
virtual bool hasCapability(Capability cap) const
Capability
Capabilities are used to determine specific features of a platform integration.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPlatformWindow class provides an abstraction for top-level windows.
\inmodule QtCore
Definition qvariant.h:65
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
static void handleScreenRemoved(QPlatformScreen *screen)
Should be called by the implementation whenever a screen is removed.
\inmodule QtGui
Definition qwindow.h:63
Event dispatcher for Windows.
Combined button and popup list for selecting options.
static void * context
#define qWarning
Definition qlogging.h:166
GLfloat GLfloat GLfloat w
[0]
GLenum cap
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define Q_UNUSED(x)
aWidget window() -> setWindowTitle("New Window Title")
[2]