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
qsurface.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
4#include "qsurface.h"
5#include "qopenglcontext.h"
6#include <qpa/qplatformintegration.h>
7#include <QtGui/private/qguiapplication_p.h>
8
10
12
13
70bool QSurface::supportsOpenGL() const
71{
72 SurfaceType type = surfaceType();
73 if (type == RasterSurface) {
74 QPlatformIntegration *integ = QGuiApplicationPrivate::instance()->platformIntegration();
75 return integ->hasCapability(QPlatformIntegration::OpenGLOnRasterSurface);
76 }
77 return type == OpenGLSurface || type == RasterGLSurface;
78}
79
102 : m_type(type), m_reserved(nullptr)
103{
104}
105
110{
111#ifndef QT_NO_OPENGL
113 if (context && context->surface() == this)
114 context->doneCurrent();
115#endif
116}
117
125
127
128#include "moc_qsurface.cpp"
129
static QGuiApplicationPrivate * instance()
\inmodule QtGui
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
The QPlatformIntegration class is the entry for WindowSystem specific functionality.
\inmodule QtGui
Definition qsurface.h:21
SurfaceClass surfaceClass() const
Returns the surface class of this surface.
Definition qsurface.cpp:121
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition qsurface.h:30
QSurface(SurfaceClass type)
Creates a surface with the given type.
Definition qsurface.cpp:101
virtual ~QSurface()
Destroys the surface.
Definition qsurface.cpp:109
SurfaceClass m_type
Definition qsurface.h:56
SurfaceClass
The SurfaceClass enum describes the actual subclass of the surface.
Definition qsurface.h:24
Combined button and popup list for selecting options.
static void * context
#define QT_IMPL_METATYPE_EXTERN_TAGGED(TYPE, TAG)
Definition qmetatype.h:1384
GLenum type
QObject::connect nullptr