QSurface Class
The QSurface class is an abstraction of renderable surfaces. More…
| Header | #include <QSurface> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Gui) |
| Module | Nt GUI C++ Classes |
| Since | 6.0 |
| Inherited by | QOffscreenSurface, QWindow |
List of all members, including inherited members
Public Types
| enum | SurfaceClass |
| enum | SurfaceType |
Public Functions
| virtual | ~QSurface() |
| SurfaceClass | surfaceClass() const |
| virtual QSurfaceFormat | format() const |
| virtual SurfaceType | surfaceType() const |
| bool | supportsOpenGL() const |
| virtual QSize | size() const |
Protected Functions
| QSurface(SurfaceClass type) |
Detailed Description
A surface is what a QOpenGLContext renders on: a QWindow or a QOffscreenSurface.
See also QWindow, QOffscreenSurface and QOpenGLContext.
Differences from Qt
There is no surfaceHandle(). Only raster and OpenGL surfaces are supported.
Member Type Documentation
enum QSurface::SurfaceClass
This enum describes what a surface is.
| Constant | Description |
|---|---|
QSurface::Window | A QWindow. |
QSurface::Offscreen | A QOffscreenSurface. |
enum QSurface::SurfaceType
This enum describes how a surface is rendered.
| Constant | Description |
|---|---|
QSurface::RasterSurface | In software, through a QBackingStore. |
QSurface::OpenGLSurface | With OpenGL, through a QOpenGLContext. |
QSurface::RasterGLSurface | Either way. |
QSurface::OpenVGSurface | With OpenVG, which Nt does not support. |
QSurface::VulkanSurface | With Vulkan, which Nt does not support. |
QSurface::MetalSurface | With Metal, which Nt does not support. |
QSurface::Direct3DSurface | With Direct3D, which Nt does not support. |
Member Function Documentation
QSurface::QSurface(SurfaceClass type)
Constructs a surface of the class type.
QSurface::~QSurface()
Destroys the surface.
QSurfaceFormat QSurface::format() const
Returns the format of the surface.
QSize QSurface::size() const
Returns the size of the surface in pixels of its coordinate system.
bool QSurface::supportsOpenGL() const
Returns true if a QOpenGLContext can render on the surface.
SurfaceClass QSurface::surfaceClass() const
Returns the class of the surface.
SurfaceType QSurface::surfaceType() const
Returns the type of the surface.