QQuickFramebufferObjectclass is a convenience class for integrating OpenGL rendering using a framebuffer object (FBO) with Qt Quick. 更多 …
def
mirrorVertically
()
def
setMirrorVertically
(enable)
def
setTextureFollowsItemSize
(follows)
def
textureFollowsItemSize
()
def
createRenderer
()
def
mirrorVerticallyChanged
(arg__1)
def
textureFollowsItemSizeChanged
(arg__1)
On most platforms, the rendering will occur on a dedicated thread . For this reason, the
QQuickFramebufferObjectclass enforces a strict separation between the item implementation and the FBO rendering. All item logic, such as properties and UI-related helper functions needed by QML should be located in aQQuickFramebufferObjectclass subclass. Everything that relates to rendering must be located in theRenderer类。警告
This class is only functional when Qt Quick is rendering via OpenGL, either directly or through the RHI-based rendering path . It is not compatible with other RHI backends, such as, Vulkan or Metal.
To avoid race conditions and read/write issues from two threads it is important that the renderer and the item never read or write shared variables. Communication between the item and the renderer should primarily happen via the
synchronize()function. This function will be called on the render thread while the GUI thread is blocked.Using queued connections or events for communication between item and renderer is also possible.
Both the Renderer and the FBO are memory managed internally.
To render into the FBO, the user should subclass the Renderer class and reimplement its
render()function. The Renderer subclass is returned fromcreateRenderer().The size of the FBO will by default adapt to the size of the item. If a fixed size is preferred, set
textureFollowsItemSizetofalseand return a texture of your choosing fromcreateFramebufferObject().Starting Qt 5.4, the
QQuickFramebufferObjectclass is atexture providerand can be used directly in ShaderEffects and other classes that consume texture providers.另请参阅
场景图形 - 渲染 FBO (帧缓冲对象) 场景图形和渲染
QQuickFramebufferObject
(
[
parent=None
]
)
¶
- param parent
构造新
QQuickFramebufferObject
采用父级
parent
.
PySide2.QtQuick.QQuickFramebufferObject.
createRenderer
(
)
¶
Reimplement this function to create a renderer used to render into the FBO.
This function will be called on the rendering thread while the GUI thread is blocked.
PySide2.QtQuick.QQuickFramebufferObject.
mirrorVertically
(
)
¶
bool
PySide2.QtQuick.QQuickFramebufferObject.
mirrorVerticallyChanged
(
arg__1
)
¶
arg__1
–
bool
PySide2.QtQuick.QQuickFramebufferObject.
setMirrorVertically
(
enable
)
¶
enable
–
bool
另请参阅
PySide2.QtQuick.QQuickFramebufferObject.
setTextureFollowsItemSize
(
follows
)
¶
follows
–
bool
PySide2.QtQuick.QQuickFramebufferObject.
textureFollowsItemSize
(
)
¶
bool
PySide2.QtQuick.QQuickFramebufferObject.
textureFollowsItemSizeChanged
(
arg__1
)
¶
arg__1
–
bool