6.0.0-rc4Source

QSurface Class

The QSurface class is an abstraction of renderable surfaces. More…

Header#include <QSurface>
CMaketarget_link_libraries(app PRIVATE Nt::Gui)
ModuleNt GUI C++ Classes
Since6.0
Inherited byQOffscreenSurface, QWindow

List of all members, including inherited members

Public Types

Public Functions

virtual ~QSurface()
SurfaceClasssurfaceClass() const
virtual QSurfaceFormatformat() const
virtual SurfaceTypesurfaceType() const
boolsupportsOpenGL() const
virtual QSizesize() 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.

ConstantDescription
QSurface::WindowA QWindow.
QSurface::OffscreenA QOffscreenSurface.

enum QSurface::SurfaceType

This enum describes how a surface is rendered.

ConstantDescription
QSurface::RasterSurfaceIn software, through a QBackingStore.
QSurface::OpenGLSurfaceWith OpenGL, through a QOpenGLContext.
QSurface::RasterGLSurfaceEither way.
QSurface::OpenVGSurfaceWith OpenVG, which Nt does not support.
QSurface::VulkanSurfaceWith Vulkan, which Nt does not support.
QSurface::MetalSurfaceWith Metal, which Nt does not support.
QSurface::Direct3DSurfaceWith Direct3D, which Nt does not support.

Member Function Documentation

[explicit, protected] QSurface::QSurface(SurfaceClass type)

Constructs a surface of the class type.

[virtual] QSurface::~QSurface()

Destroys the surface.

[virtual] QSurfaceFormat QSurface::format() const

Returns the format of the surface.

[virtual] 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.

[virtual] SurfaceType QSurface::surfaceType() const

Returns the type of the surface.