QtBase  v6.3.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QSurface Class Referenceabstract

The QSurface class is an abstraction of renderable surfaces in Qt. More...

#include <qsurface.h>

Inheritance diagram for QSurface:
Inheritance graph
[legend]

Public Types

enum  SurfaceClass { Window , Offscreen }
 
enum  SurfaceType {
  RasterSurface , OpenGLSurface , RasterGLSurface , OpenVGSurface ,
  VulkanSurface , MetalSurface , Direct3DSurface
}
 

Public Member Functions

virtual ~QSurface ()
 
SurfaceClass surfaceClass () const
 
virtual QSurfaceFormat format () const =0
 
virtual QPlatformSurfacesurfaceHandle () const =0
 
virtual SurfaceType surfaceType () const =0
 
bool supportsOpenGL () const
 
virtual QSize size () const =0
 

Protected Member Functions

 QSurface (SurfaceClass type)
 

Protected Attributes

SurfaceClass m_type
 
QSurfacePrivate * m_reserved
 

Detailed Description

The QSurface class is an abstraction of renderable surfaces in Qt.

\inmodule QtGui

Since
5.0

The size of the surface is accessible with the size() function. The rendering specific attributes of the surface are accessible through the format() function.

Definition at line 56 of file qsurface.h.

Member Enumeration Documentation

◆ SurfaceClass

The SurfaceClass enum describes the actual subclass of the surface.

\value Window The surface is an instance of QWindow. \value Offscreen The surface is an instance of QOffscreenSurface.

Enumerator
Window 
Offscreen 

Definition at line 60 of file qsurface.h.

◆ SurfaceType

The SurfaceType enum describes what type of surface this is.

\value RasterSurface The surface is is composed of pixels and can be rendered to using a software rasterizer like Qt's raster paint engine. \value OpenGLSurface The surface is an OpenGL compatible surface and can be used in conjunction with QOpenGLContext. \value RasterGLSurface The surface can be rendered to using a software rasterizer, and also supports OpenGL. This surface type is intended for internal Qt use, and requires the use of private API. \value OpenVGSurface The surface is an OpenVG compatible surface and can be used in conjunction with OpenVG contexts. \value VulkanSurface The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API. \value MetalSurface The surface is a Metal compatible surface and can be used in conjunction with Apple's Metal graphics API. This surface type is only supported on \macos and iOS. \value Direct3DSurface The surface is a Direct 3D 11 and 12 compatible surface and can be used in conjunction with the DXGI and Direct3D APIs. This surface type is only supported on Windows.

Enumerator
RasterSurface 
OpenGLSurface 
RasterGLSurface 
OpenVGSurface 
VulkanSurface 
MetalSurface 
Direct3DSurface 

Definition at line 66 of file qsurface.h.

Constructor & Destructor Documentation

◆ ~QSurface()

QSurface::~QSurface ( )
virtual

Destroys the surface.

Definition at line 147 of file qsurface.cpp.

Here is the call graph for this function:

◆ QSurface()

QSurface::QSurface ( SurfaceClass  type)
explicitprotected

Creates a surface with the given type.

Definition at line 139 of file qsurface.cpp.

Member Function Documentation

◆ format()

QSurfaceFormat QSurface::format ( ) const
pure virtual

Returns the format of the surface.

Implemented in QOffscreenSurface.

Here is the caller graph for this function:

◆ size()

QSize QSurface::size ( ) const
pure virtual

Returns the size of the surface in pixels.

Implemented in QOffscreenSurface.

◆ supportsOpenGL()

bool QSurface::supportsOpenGL ( ) const

Returns true if the surface is OpenGL compatible and can be used in conjunction with QOpenGLContext; otherwise returns false.

Since
5.3

Definition at line 108 of file qsurface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ surfaceClass()

QSurface::SurfaceClass QSurface::surfaceClass ( ) const

Returns the surface class of this surface.

Definition at line 159 of file qsurface.cpp.

Here is the caller graph for this function:

◆ surfaceHandle()

QPlatformSurface * QSurface::surfaceHandle ( ) const
pure virtual

Returns a handle to the platform-specific implementation of the surface.

Here is the caller graph for this function:

◆ surfaceType()

SurfaceType QSurface::surfaceType ( ) const
pure virtual

Returns the type of the surface.

Implemented in QOffscreenSurface.

Here is the caller graph for this function:

Member Data Documentation

◆ m_reserved

QSurfacePrivate* QSurface::m_reserved
protected

Definition at line 94 of file qsurface.h.

◆ m_type

SurfaceClass QSurface::m_type
protected

Definition at line 92 of file qsurface.h.


The documentation for this class was generated from the following files: