The QSurface 類是 Qt 中可渲染錶麵的抽象。 更多...
| 頭: | #include <QSurface> |
| qmake: | QT += gui |
| Since: | Qt 5.0 |
| 繼承者: | QOffscreenSurface and QWindow |
| enum | SurfaceClass { Window, Offscreen } |
| enum | SurfaceType { RasterSurface, OpenGLSurface, RasterGLSurface, OpenVGSurface, VulkanSurface, MetalSurface } |
| virtual | ~QSurface () |
| virtual QSurfaceFormat | format () const = 0 |
| virtual QSize | size () const = 0 |
| bool | supportsOpenGL () const |
| QSurface::SurfaceClass | surfaceClass () const |
| virtual QPlatformSurface * | surfaceHandle () const = 0 |
| virtual QSurface::SurfaceType | surfaceType () const = 0 |
| const QMetaObject | staticMetaObject |
| QSurface (QSurface::SurfaceClass type ) |
| QSurfacePrivate * | m_reserved |
| QSurface::SurfaceClass | m_type |
The QSurface 類是 Qt 中可渲染錶麵的抽象。
錶麵尺寸可訪問采用 size () 函數。錶麵的渲染特定屬性可訪問透過 format () 函數。
SurfaceClass 枚舉描述錶麵的實際子類。
| 常量 | 值 | 描述 |
|---|---|---|
QSurface::Window
|
0
|
錶麵是實例化的 QWindow . |
QSurface::Offscreen
|
1
|
錶麵是實例化的 QOffscreenSurface . |
SurfaceType 枚舉描述錶麵是什麼類型。
| 常量 | 值 | 描述 |
|---|---|---|
QSurface::RasterSurface
|
0
|
錶麵由像素組成,且可以使用軟件光柵化器 (像 Qt 的光柵繪製引擎) 渲染。 |
QSurface::OpenGLSurface
|
1
|
錶麵是 OpenGL 兼容錶麵且可以用於結閤 QOpenGLContext . |
QSurface::RasterGLSurface
|
2
|
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
|
3
|
The surface is an OpenVG compatible surface and can be used in conjunction with OpenVG contexts. |
QSurface::VulkanSurface
|
4
|
The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API. |
QSurface::MetalSurface
|
5
|
The surface is a Metal compatible surface and can be used in conjunction with Apple's Metal graphics API. This surface type is supported on macOS 僅。 |
[protected]
QSurface::
QSurface
(
QSurface::SurfaceClass
type
)
創建錶麵,采用給定 type .
[虛擬]
QSurface::
~QSurface
()
銷毀此錶麵。
[pure virtual]
QSurfaceFormat
QSurface::
format
() const
返迴錶麵的格式。
[pure virtual]
QSize
QSurface::
size
() const
返迴錶麵大小 (以像素為單位)。
返迴 true 若錶麵兼容 OpenGL 且可以用於結閤 QOpenGLContext ;否則返迴 false。
該函數在 Qt 5.3 引入。
返迴此錶麵的錶麵類。
[pure virtual]
QPlatformSurface
*QSurface::
surfaceHandle
() const
返迴特定平颱的錶麵實現句柄。
[pure virtual]
QSurface::SurfaceType
QSurface::
surfaceType
() const
返迴錶麵的類型。