QSurface#
The QSurface
class is an abstraction of renderable surfaces in Qt. More…
Inherited by: QWindow, QQuickWindow, QQuickView, QPaintDeviceWindow, QOpenGLWindow, QRasterWindow, QOffscreenSurface, Qt3DWindow
Synopsis#
Functions#
def
supportsOpenGL
()def
surfaceClass
()
Virtual functions#
def
format
()def
size
()def
surfaceHandle
()def
surfaceType
()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
The size of the surface is accessible with the size()
function. The rendering specific attributes of the surface are accessible through the format()
function.
- class PySide6.QtGui.QSurface(type)#
- Parameters:
type –
SurfaceClass
Creates a surface with the given type
.
- PySide6.QtGui.QSurface.SurfaceClass#
The SurfaceClass enum describes the actual subclass of the surface.
Constant
Description
QSurface.Window
The surface is an instance of
QWindow
.QSurface.Offscreen
The surface is an instance of
QOffscreenSurface
.
- PySide6.QtGui.QSurface.SurfaceType#
The SurfaceType enum describes what type of surface this is.
Constant
Description
QSurface.RasterSurface
The surface is composed of pixels and can be rendered to using a software rasterizer like Qt’s raster paint engine.
QSurface.OpenGLSurface
The surface is an OpenGL compatible surface and can be used in conjunction with
QOpenGLContext
.QSurface.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.
QSurface.OpenVGSurface
The surface is an OpenVG compatible surface and can be used in conjunction with OpenVG contexts.
QSurface.VulkanSurface
The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API.
QSurface.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.
QSurface.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.
- PySide6.QtGui.QSurface.m_type#
- abstract PySide6.QtGui.QSurface.format()#
- Return type:
Returns the format of the surface.
- abstract PySide6.QtGui.QSurface.size()#
- Return type:
Returns the size of the surface in pixels.
- PySide6.QtGui.QSurface.supportsOpenGL()#
- Return type:
bool
Returns true if the surface is OpenGL compatible and can be used in conjunction with QOpenGLContext
; otherwise returns false.
- PySide6.QtGui.QSurface.surfaceClass()#
- Return type:
Returns the surface class of this surface.
- abstract PySide6.QtGui.QSurface.surfaceHandle()#
- Return type:
QPlatformSurface
Returns a handle to the platform-specific implementation of the surface.
- abstract PySide6.QtGui.QSurface.surfaceType()#
- Return type:
Returns the type of the surface.