PySide6.QtQuick.QQuickGraphicsDevice¶
- class QQuickGraphicsDevice¶
- The - QQuickGraphicsDeviceclass provides an opaque container for native graphics objects representing graphics devices or contexts.- Details- See also - Synopsis¶- Methods¶- def - __init__()
- def - isNull()
 - Static functions¶
- def - fromRhi()
- def - fromRhiAdapter()
 - 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 - __init__()¶
 - Constructs a default - QQuickGraphicsDevicethat does not reference any native objects.- __init__(other)
- Parameters:
- other – - QQuickGraphicsDevice
 
 - static fromOpenGLContext(context)¶
- Parameters:
- context – - QOpenGLContext
- Return type:
 
 - Returns a new - QQuickGraphicsDevicereferencing an existing OpenGL- context.- This factory function is suitable for OpenGL. - Note - It is up the caller to ensure that - contextis going to be compatible and usable with the- QQuickWindow. Platform-specific mismatches in the associated QSurfaceFormat, or threading issues due to attempting to use- contexton multiple threads are up to the caller to avoid.- static fromRhi(rhi)¶
- Parameters:
- rhi – - QRhi
- Return type:
 
 - Returns a new - QQuickGraphicsDevicereferencing an existing- rhiobject.- Note - Similarly to - fromOpenGLContext(), the caller must be careful to only share a QRhi (and so the underlying graphics context or device) between QQuickWindows that are known to be compatible, not breaking the underlying graphics API’s rules when it comes to threading, pixel formats, etc.- static fromRhiAdapter(adapter)¶
- Parameters:
- adapter – - QRhiAdapter
- Return type:
 
 - Returns a new - QQuickGraphicsDevicereferencing an existing- adapterQRhiAdapter object.- Not applicable to QRhi backends and graphics APIs where QRhiAdapter does not have a real implementation. - Equivalent to - fromAdapter()for Direct 3D, and- fromPhysicalDevice()for Vulkan.- Note - Ownership is not taken for - adapter, and it must stay valid at minimum until the scene graph intializes, which most likely happens when the associated- QQuickWindowbecomes exposed.- See also - enumerateAdapters()- isNull()¶
- Return type:
- bool 
 
 - Returns true if this is a default constructed graphics device that does not reference any native objects.