QQuickWindowclass provides the window for displaying a graphical QML scene. 更多 …
继承者: QQuickView
def
activeFocusItem
()
def
beginExternalCommands
()
def
clearBeforeRendering
()
def
color
()
def
contentItem
()
def
createTextureFromId
(id, size[, options=QQuickWindow.CreateTextureOption()])
def
createTextureFromImage
(image)
def
createTextureFromImage
(image, options)
def
createTextureFromNativeObject
(type, nativeObjectPtr, nativeLayout, size[, options=QQuickWindow.CreateTextureOption()])
def
effectiveDevicePixelRatio
()
def
endExternalCommands
()
def
grabWindow
()
def
incubationController
()
def
isPersistentOpenGLContext
()
def
isPersistentSceneGraph
()
def
isSceneGraphInitialized
()
def
mouseGrabberItem
()
def
openglContext
()
def
renderTarget
()
def
renderTargetId
()
def
renderTargetSize
()
def
resetOpenGLState
()
def
scheduleRenderJob
(job, schedule)
def
sendEvent
(arg__1, arg__2)
def
setClearBeforeRendering
(enabled)
def
setColor
(color)
def
setPersistentOpenGLContext
(persistent)
def
setPersistentSceneGraph
(persistent)
def
setRenderTarget
(fbo)
def
setRenderTarget
(fboId, size)
def
releaseResources
()
def
update
()
def
activeFocusItemChanged
()
def
afterAnimating
()
def
afterRenderPassRecording
()
def
afterRendering
()
def
afterSynchronizing
()
def
beforeRenderPassRecording
()
def
beforeRendering
()
def
beforeSynchronizing
()
def
colorChanged
(arg__1)
def
frameSwapped
()
def
openglContextCreated
(context)
def
sceneGraphAboutToStop
()
def
sceneGraphError
(error, message)
def
sceneGraphInitialized
()
def
sceneGraphInvalidated
()
def
hasDefaultAlphaBuffer
()
def
sceneGraphBackend
()
def
setDefaultAlphaBuffer
(useAlpha)
def
setSceneGraphBackend
(backend)
def
setTextRenderType
(renderType)
def
textRenderType
()
QQuickWindowprovides the graphical scene management needed to interact with and display a scene of QQuickItems.A
QQuickWindowalways has a single invisible root item. To add items to this window, reparent the items to the root item or to an existing item in the scene.For easily displaying a scene from a QML file, see
QQuickView.
QQuickWindowuses a scene graph to represent what needs to be rendered. This scene graph is disconnected from the QML scene and potentially lives in another thread, depending on the platform implementation. Since the rendering scene graph lives independently from the QML scene, it can also be completely released without affecting the state of the QML scene.
sceneGraphInitialized()signal is emitted on the rendering thread before the QML scene is rendered to the screen for the first time. If the rendering scene graph has been released, the signal will be emitted again before the next frame is rendered.
When using the default OpenGL adaptation, it is possible to integrate OpenGL calls directly into the
QQuickWindowusing the same OpenGL context as the Qt Quick Scene Graph. This is done by connecting to thebeforeRendering()orafterRendering()信号。注意
当使用
beforeRendering(), make sure to disable clearing before rendering withsetClearBeforeRendering().
当
QQuickWindowinstance is deliberately hidden withhide()orsetVisible(false), it will stop rendering and its scene graph and graphics context might be released. ThesceneGraphInvalidated()signal will be emitted when this happens.警告
It is crucial that graphics operations and interaction with the scene graph happens exclusively on the rendering thread, primarily during the updatePaintNode() phase.
警告
As signals related to rendering might be emitted from the rendering thread, connections should be made using
DirectConnection.
QML will try to cache images and scene graph nodes to improve performance, but in some low-memory scenarios it might be required to aggressively release these resources. The
releaseResources()can be used to force the clean up of certain resources. CallingreleaseResources()may result in the entire scene graph and in the case of the OpenGL adaptation the associated context will be deleted. ThesceneGraphInvalidated()signal will be emitted when this happens.注意
All classes with QSG prefix should be used solely on the scene graph’s rendering thread. See 场景图形和渲染 了解更多信息。
While it is possible to specify a
QSurfaceFormatfor everyQQuickWindowby calling the member functionsetFormat(), windows may also be created from QML by using the Window and ApplicationWindow elements. In this case there is no C++ code involved in the creation of the window instance, yet applications may still wish to set certain surface format values, for example to request a given OpenGL version or profile. Such applications can call the static functionsetDefaultFormat()at startup. The specified format will be used for all Quick windows created afterwards.另请参阅
QQuickWindow
(
renderControl
)
¶
QQuickWindow([parent=None])
- param parent
QWindow- param renderControl
Constructs a window for displaying a QML scene with parent window
parent
.
PySide2.QtQuick.QQuickWindow.
CreateTextureOption
¶
The enums are used to customize a texture is wrapped.
|
常量 |
描述 |
|---|---|
|
QQuickWindow.TextureHasAlphaChannel |
The texture has an alpha channel and should be drawn using blending. |
|
QQuickWindow.TextureHasMipmaps |
The texture has mipmaps and can be drawn with mipmapping enabled. |
|
QQuickWindow.TextureOwnsGLTexture |
The texture object owns the texture id and will delete the OpenGL texture when the texture object is deleted. |
|
QQuickWindow.TextureCanUseAtlas |
The image can be uploaded into a texture atlas. |
|
QQuickWindow.TextureIsOpaque |
The texture will return false for
|
PySide2.QtQuick.QQuickWindow.
RenderStage
¶
|
常量 |
描述 |
|---|---|
|
QQuickWindow.BeforeSynchronizingStage |
Before synchronization. |
|
QQuickWindow.AfterSynchronizingStage |
After synchronization. |
|
QQuickWindow.BeforeRenderingStage |
Before rendering. |
|
QQuickWindow.AfterRenderingStage |
After rendering. |
|
QQuickWindow.AfterSwapStage |
After the frame is swapped. |
|
QQuickWindow.NoStage |
As soon as possible. This value was added in Qt 5.6. |
另请参阅
PySide2.QtQuick.QQuickWindow.
SceneGraphError
¶
This enum describes the error in a
sceneGraphError()
信号。
|
常量 |
描述 |
|---|---|
|
QQuickWindow.ContextNotAvailable |
graphics context creation failed. This typically means that no suitable OpenGL implementation was found, for example because no graphics drivers are installed and so no OpenGL 2 support is present. On mobile and embedded boards that use OpenGL ES such an error is likely to indicate issues in the windowing system integration and possibly an incorrect configuration of Qt. |
PySide2.QtQuick.QQuickWindow.
TextRenderType
¶
This enum describes the default render type of text-like elements in Qt Quick ( 文本 , TextInput , etc.).
Select if you prefer text to look native on the target platform and do not require advanced features such as transformation of the text. Using such features in combination with the render type will lend poor and sometimes pixelated results.
|
常量 |
描述 |
|---|---|
|
QQuickWindow.QtTextRendering |
Use Qt’s own rasterization algorithm. |
|
QQuickWindow.NativeTextRendering |
Use the operating system’s native rasterizer for text. |
New in version 5.10.
PySide2.QtQuick.QQuickWindow.
NativeObjectType
¶
Specifies the type of the native object passed to functions such as
createTextureFromNativeObject()
.
|
常量 |
描述 |
|---|---|
|
QQuickWindow.NativeObjectTexture |
The native object is a 2D texture (OpenGL, Direct3D 11, Metal) or image (Vulkan). |
New in version 5.14.
PySide2.QtQuick.QQuickWindow.
activeFocusItem
(
)
¶
PySide2.QtQuick.QQuickWindow.
activeFocusItemChanged
(
)
¶
PySide2.QtQuick.QQuickWindow.
afterAnimating
(
)
¶
PySide2.QtQuick.QQuickWindow.
afterRenderPassRecording
(
)
¶
PySide2.QtQuick.QQuickWindow.
afterRendering
(
)
¶
PySide2.QtQuick.QQuickWindow.
afterSynchronizing
(
)
¶
PySide2.QtQuick.QQuickWindow.
beforeRenderPassRecording
(
)
¶
PySide2.QtQuick.QQuickWindow.
beforeRendering
(
)
¶
PySide2.QtQuick.QQuickWindow.
beforeSynchronizing
(
)
¶
PySide2.QtQuick.QQuickWindow.
beginExternalCommands
(
)
¶
When mixing raw graphics (OpenGL, Vulkan, Metal, etc.) commands with scene graph rendering, it is necessary to call this function before recording commands to the command buffer used by the scene graph to render its main render pass. This is to avoid clobbering state.
In practice this function is often called from a slot connected to the
beforeRenderPassRecording()
or
afterRenderPassRecording()
signals.
The function does not need to be called when recording commands to the application’s own command buffer (such as, a VkCommandBuffer or MTLCommandBuffer + MTLRenderCommandEncoder created and managed by the application, not retrieved from the scene graph). With graphics APIs where no native command buffer concept is exposed (OpenGL, Direct 3D 11), and
endExternalCommands()
together provide a replacement for
resetOpenGLState()
.
Calling this function and
endExternalCommands()
is not necessary within the
render()
implementation of a
QSGRenderNode
because the scene graph performs the necessary steps implicitly for render nodes.
Native graphics objects (such as, graphics device, command buffer or encoder) are accessible via
getResource()
.
警告
Watch out for the fact that
CommandListResource
may return a different object between -
endExternalCommands()
. This can happen when the underlying implementation provides a dedicated secondary command buffer for recording external graphics commands within a render pass. Therefore, always query CommandListResource after calling this function. Do not attempt to reuse an object from an earlier query.
注意
This function has no effect when the scene graph is using OpenGL directly and the RHI graphics abstraction layer is not in use. Refer to
resetOpenGLState()
in that case.
注意
When the scenegraph is using the RHI graphics abstraction layer with the OpenGL backend underneath, pay attention to the fact that the OpenGL state in the context can have arbitrary settings, and this function does not perform any resetting of the state back to defaults. Call
resetOpenGLState()
if that is seen necessary.
PySide2.QtQuick.QQuickWindow.
clearBeforeRendering
(
)
¶
bool
Returns whether clearing of the color buffer is done before rendering or not.
PySide2.QtQuick.QQuickWindow.
color
(
)
¶
QColor
另请参阅
PySide2.QtQuick.QQuickWindow.
colorChanged
(
arg__1
)
¶
arg__1
–
QColor
PySide2.QtQuick.QQuickWindow.
contentItem
(
)
¶
PySide2.QtQuick.QQuickWindow.
createTextureFromId
(
id
,
size
[
,
options=QQuickWindow.CreateTextureOption()
]
)
¶
id
–
uint
size
–
QSize
options
–
CreateTextureOptions
注意
此函数被弃用。
创建新
QSGTexture
object from an existing OpenGL texture
id
and
size
.
The caller of the function is responsible for deleting the returned texture.
The returned texture will be using
GL_TEXTURE_2D
as texture target and assumes that internal format is
GL_RGBA
. Reimplement
QSGTexture
to create textures with different parameters.
使用
options
to customize the texture attributes. The TextureUsesAtlas option is ignored.
警告
This function will return null if the scenegraph has not yet been initialized or OpenGL is not in use.
注意
This function only has an effect when using the default OpenGL scene graph adaptation.
注意
This function has no effect when running on the RHI graphics abstraction. Use
createTextureFromNativeObject()
代替。
PySide2.QtQuick.QQuickWindow.
createTextureFromImage
(
image
)
¶
image
–
QImage
这是重载函数。
PySide2.QtQuick.QQuickWindow.
createTextureFromImage
(
image
,
options
)
¶
image
–
QImage
options
–
CreateTextureOptions
创建新
QSGTexture
from the supplied
image
. If the image has an alpha channel, the corresponding texture will have an alpha channel.
The caller of the function is responsible for deleting the returned texture. For example whe using the OpenGL adaptation the actual OpenGL texture will be deleted when the texture object is deleted.
当
options
contains
TextureCanUseAtlas
, the engine may put the image into a texture atlas. Textures in an atlas need to rely on
normalizedTextureSubRect()
for their geometry and will not support
Repeat
. Other values from
CreateTextureOption
被忽略。
当
options
contains
TextureIsOpaque
, the engine will create an RGB texture which returns false for
hasAlphaChannel()
. Opaque textures will in most cases be faster to render. When this flag is not set, the texture will have an alpha channel based on the image’s format.
当
options
contains
TextureHasMipmaps
, the engine will create a texture which can use mipmap filtering. Mipmapped textures can not be in an atlas.
When using the OpenGL adaptation, the returned texture will be using
GL_TEXTURE_2D
as texture target and
GL_RGBA
as internal format. Reimplement
QSGTexture
to create textures with different parameters.
警告
This function will return 0 if the scene graph has not yet been initialized.
警告
The returned texture is not memory managed by the scene graph and must be explicitly deleted by the caller on the rendering thread. This is achieved by deleting the texture from a
QSGNode
destructor or by using
deleteLater()
in the case where the texture already has affinity to the rendering thread.
This function can be called from any thread.
PySide2.QtQuick.QQuickWindow.
createTextureFromNativeObject
(
type
,
nativeObjectPtr
,
nativeLayout
,
size
[
,
options=QQuickWindow.CreateTextureOption()
]
)
¶
type
–
NativeObjectType
nativeObjectPtr
–
void
nativeLayout
–
int
size
–
QSize
options
–
CreateTextureOptions
创建新
QSGTexture
object from an existing native object.
本机对象被包裹 (但不归其所有) 通过结果
QSGTexture
。函数调用者负责删除返回的
QSGTexture
,但不会销毁底层本机对象。
type
specifies the type of the object. In practice the type is
NativeObjectTexture
, indicating that the native object is a texture or image of the underlying graphics API. Other types may be introduced in the future.
此函数目前仅适用于 2D RGBA 纹理。
不像
createTextureFromId()
, this function supports both direct OpenGL usage and the RHI abstracted rendering path.
警告
This function will return null if the scenegraph has not yet been initialized.
使用
options
to customize the texture attributes. Only the
TextureHasAlphaChannel
and
TextureHasMipmaps
are taken into account here.
警告
不像
createTextureFromId()
, this function never takes ownership of the native object, and the
TextureOwnsGLTexture
flag is ignored.
size
指定大小 (以像素为单位)。
nativeObjectPtr
is a pointer to the native object handle. With OpenGL, the native handle is a GLuint value, so
nativeObjectPtr
is then a pointer to a GLuint. With Vulkan, the native handle is a VkImage, so
nativeObjectPtr
is a pointer to a VkImage. With Direct3D 11 and Metal
nativeObjectPtr
is a pointer to a ID3D11Texture2D or MTLTexture pointer.
注意
Pay attention to the fact that
nativeObjectPtr
is always a pointer to the native texture handle type, even if the native type itself is a pointer.
nativeLayout
is only used for APIs like Vulkan. When applicable, it must specify the current image layout, such as, a VkImageLayout value.
另请参阅
sceneGraphInitialized()
QSGTexture
nativeTexture()
PySide2.QtQuick.QQuickWindow.
effectiveDevicePixelRatio
(
)
¶
qreal
Returns the device pixel ratio for this window.
This is different from
devicePixelRatio()
in that it supports redirected rendering via
QQuickRenderControl
. When using a
QQuickRenderControl
,
QQuickWindow
is often not created, meaning it is never shown and there is no underlying native window created in the windowing system. As a result, querying properties like the device pixel ratio cannot give correct results. Use this function instead.
另请参阅
devicePixelRatio()
PySide2.QtQuick.QQuickWindow.
endExternalCommands
(
)
¶
When mixing raw graphics (OpenGL, Vulkan, Metal, etc.) commands with scene graph rendering, it is necessary to call this function after recording commands to the command buffer used by the scene graph to render its main render pass. This is to avoid clobbering state.
In practice this function is often called from a slot connected to the
beforeRenderPassRecording()
or
afterRenderPassRecording()
signals.
The function does not need to be called when recording commands to the application’s own command buffer (such as, a VkCommandBuffer or MTLCommandBuffer + MTLRenderCommandEncoder created and managed by the application, not retrieved from the scene graph). With graphics APIs where no native command buffer concept is exposed (OpenGL, Direct 3D 11),
beginExternalCommands()
and together provide a replacement for
resetOpenGLState()
.
Calling this function and
beginExternalCommands()
is not necessary within the
render()
implementation of a
QSGRenderNode
because the scene graph performs the necessary steps implicitly for render nodes.
注意
This function has no effect when the scene graph is using OpenGL directly and the RHI graphics abstraction layer is not in use. Refer to
resetOpenGLState()
in that case.
PySide2.QtQuick.QQuickWindow.
frameSwapped
(
)
¶
PySide2.QtQuick.QQuickWindow.
grabWindow
(
)
¶
QImage
Grabs the contents of the window and returns it as an image.
It is possible to call the function when the window is not visible. This requires that the window is
created
and has a valid size and that no other
QQuickWindow
instances are rendering in the same process.
警告
Calling this function will cause performance problems.
警告
This function can only be called from the GUI thread.
PySide2.QtQuick.QQuickWindow.
hasDefaultAlphaBuffer
(
)
¶
bool
Returns whether to use alpha transparency on newly created windows.
PySide2.QtQuick.QQuickWindow.
incubationController
(
)
¶
QQmlIncubationController
Returns an incubation controller that splices incubation between frames for this window.
QQuickView
automatically installs this controller for you, otherwise you will need to install it yourself using
setIncubationController()
.
The controller is owned by the window and will be destroyed when the window is deleted.
PySide2.QtQuick.QQuickWindow.
isPersistentOpenGLContext
(
)
¶
bool
Returns whether the OpenGL context can be released during the lifetime of the
QQuickWindow
.
注意
This is a hint. When and how this happens is implementation specific. It also only has an effect when using the default OpenGL scene graph adaptation
PySide2.QtQuick.QQuickWindow.
isPersistentSceneGraph
(
)
¶
bool
Returns whether the scene graph nodes and resources can be released during the lifetime of this
QQuickWindow
.
注意
This is a hint. When and how this happens is implementation specific.
PySide2.QtQuick.QQuickWindow.
isSceneGraphInitialized
(
)
¶
bool
Returns true if the scene graph has been initialized; otherwise returns false.
PySide2.QtQuick.QQuickWindow.
mouseGrabberItem
(
)
¶
Returns the item which currently has the mouse grab.
PySide2.QtQuick.QQuickWindow.
openglContext
(
)
¶
QOpenGLContext
Returns the OpenGL context used for rendering.
注意
If the scene graph is not ready, or the scene graph is not using OpenGL (or RHI over OpenGL), this function will return null.
PySide2.QtQuick.QQuickWindow.
openglContextCreated
(
context
)
¶
context
–
QOpenGLContext
PySide2.QtQuick.QQuickWindow.
releaseResources
(
)
¶
This function tries to release redundant resources currently held by the QML scene.
Calling this function might result in the scene graph and the OpenGL context used for rendering being released to release graphics memory. If this happens, the
sceneGraphInvalidated()
signal will be called, allowing users to clean up their own graphics resources. The
setPersistentOpenGLContext()
and
setPersistentSceneGraph()
functions can be used to prevent this from happening, if handling the cleanup is not feasible in the application, at the cost of higher memory usage.
PySide2.QtQuick.QQuickWindow.
renderTarget
(
)
¶
QOpenGLFramebufferObject
Returns the render target for this window.
The default is to render to the surface of the window, in which case the render target is 0.
注意
This function will return nullptr when not using the OpenGL scene graph adaptation.
注意
This function has no effect and returns nullptr when running on the RHI graphics abstraction.
另请参阅
PySide2.QtQuick.QQuickWindow.
renderTargetId
(
)
¶
uint
Returns the FBO id of the render target when set; otherwise returns 0.
PySide2.QtQuick.QQuickWindow.
renderTargetSize
(
)
¶
QSize
Returns the size of the currently set render target; otherwise returns an empty size.
PySide2.QtQuick.QQuickWindow.
resetOpenGLState
(
)
¶
Call this function to reset the OpenGL context its default state.
The scene graph uses the OpenGL context and will both rely on and clobber its state. When mixing raw OpenGL commands with scene graph rendering, this function provides a convenient way of resetting the OpenGL context state back to its default values.
This function does not touch state in the fixed-function pipeline.
This function does not clear the color, depth and stencil buffers. Use
setClearBeforeRendering
to control clearing of the color buffer. The depth and stencil buffer might be clobbered by the scene graph renderer. Clear these manually on demand.
注意
This function only has an effect when using the default OpenGL scene graph adaptation.
注意
This function will only reset the OpenGL context in relation to what has been changed internally as part of the OpenGL scene graph. It does not reset anything that has been changed externally such as direct OpenGL calls done inside the application code if those same calls are not used internally.
注意
This function has no effect when running on the RHI graphics abstraction and the underlying RHI backend is not OpenGL.
PySide2.QtQuick.QQuickWindow.
sceneGraphAboutToStop
(
)
¶
PySide2.QtQuick.QQuickWindow.
sceneGraphBackend
(
)
¶
unicode
Returns the requested Qt Quick scenegraph backend.
注意
The return value of this function may still be outdated by subsequent calls to
setSceneGraphBackend()
until the first
QQuickWindow
in the application has been constructed.
PySide2.QtQuick.QQuickWindow.
sceneGraphError
(
error
,
message
)
¶
error
–
SceneGraphError
message – unicode
PySide2.QtQuick.QQuickWindow.
sceneGraphInitialized
(
)
¶
PySide2.QtQuick.QQuickWindow.
sceneGraphInvalidated
(
)
¶
PySide2.QtQuick.QQuickWindow.
scheduleRenderJob
(
job
,
schedule
)
¶
job
–
QRunnable
schedule
–
RenderStage
Schedules
job
to run when the rendering of this window reaches the given
stage
.
This is a convenience to the equivalent signals in
QQuickWindow
for “one shot” tasks.
The window takes ownership over
job
and will delete it when the job is completed.
If rendering is shut down before
job
has a chance to run, the job will be run and then deleted as part of the scene graph cleanup. If the window is never shown and no rendering happens before the
QQuickWindow
is destroyed, all pending jobs will be destroyed without their run() method being called.
If the rendering is happening on a different thread, then the job will happen on the rendering thread.
若
stage
is
NoStage
,
job
will be run at the earliest opportunity whenever the render thread is not busy rendering a frame. If there is no OpenGL context available or the window is not exposed at the time the job is either posted or handled, it is deleted without executing the run() method. If a non-threaded renderer is in use, the run() method of the job is executed synchronously. The OpenGL context is changed to the renderer context before executing a
NoStage
job.
注意
This function does not trigger rendering; the jobs targeting any other stage than
NoStage
will be stored run until rendering is triggered elsewhere. To force the job to run earlier, call
update()
;
PySide2.QtQuick.QQuickWindow.
sendEvent
(
arg__1
,
arg__2
)
¶
arg__1
–
QQuickItem
arg__2
–
QEvent
bool
注意
此函数被弃用。
Propagates an event
e
到
QQuickItem
item
on the window.
使用
sendEvent()
directly instead.
The return value is currently not used.
PySide2.QtQuick.QQuickWindow.
setClearBeforeRendering
(
enabled
)
¶
enabled
–
bool
Sets whether the scene graph rendering of QML should clear the color buffer before it starts rendering to
enabled
.
By disabling clearing of the color buffer, it is possible to render OpengGL content under the scene graph.
The color buffer is cleared by default.
警告
This flag is ignored completely when running with the RHI graphics abstraction instead of using OpenGL directly. As explicit clear commands simply do not exist in some modern APIs, the scene graph cannot offer this flexibility anymore. The images associated with a render target will always get cleared when a render pass starts. As a solution, an alternative to disabling scene graph issued clears is provided in form of the
beforeRenderPassRecording()
信号。
PySide2.QtQuick.QQuickWindow.
setDefaultAlphaBuffer
(
useAlpha
)
¶
useAlpha
–
bool
useAlpha
specifies whether to use alpha transparency on newly created windows.
In any application which expects to create translucent windows, it’s necessary to set this to true before creating the first
QQuickWindow
. The default value is false.
PySide2.QtQuick.QQuickWindow.
setPersistentOpenGLContext
(
persistent
)
¶
persistent
–
bool
Sets whether the OpenGL context should be preserved, and cannot be released until the last window is deleted, to
persistent
. The default value is true.
The OpenGL context can be released to free up graphics resources when the window is obscured, hidden or not rendering. When this happens is implementation specific.
aboutToBeDestroyed()
signal is emitted from the
openglContext()
when the OpenGL context is about to be released. The
sceneGraphInitialized()
signal is emitted when a new OpenGL context is created for this window. Make a
DirectConnection
to these signals to be notified.
The OpenGL context is still released when the last
QQuickWindow
被删除。
注意
This only has an effect when using the default OpenGL scene graph adaptation.
另请参阅
isPersistentOpenGLContext()
setPersistentSceneGraph()
aboutToBeDestroyed()
sceneGraphInitialized()
PySide2.QtQuick.QQuickWindow.
setPersistentSceneGraph
(
persistent
)
¶
persistent
–
bool
Sets whether the scene graph nodes and resources can be released to
persistent
. The default value is true.
The scene graph nodes and resources can be released to free up graphics resources when the window is obscured, hidden or not rendering. When this happens is implementation specific.
sceneGraphInvalidated()
signal is emitted when cleanup occurs. The
sceneGraphInitialized()
signal is emitted when a new scene graph is recreated for this window. Make a
DirectConnection
to these signals to be notified.
The scene graph nodes and resources are still released when the last
QQuickWindow
被删除。
PySide2.QtQuick.QQuickWindow.
setRenderTarget
(
fbo
)
¶
fbo
–
QOpenGLFramebufferObject
Sets the render target for this window to be
fbo
.
The specified fbo must be created in the context of the window or one that shares with it.
注意
This function only has an effect when using the default OpenGL scene graph adaptation.
注意
This function has no effect when running on the RHI graphics abstraction.
警告
This function can only be called from the thread doing the rendering.
另请参阅
PySide2.QtQuick.QQuickWindow.
setRenderTarget
(
fboId
,
size
)
¶
fboId
–
uint
size
–
QSize
这是重载函数。
Sets the render target for this window to be an FBO with
fboId
and
size
.
The specified FBO must be created in the context of the window or one that shares with it.
注意
fboId
can also be set to 0. In this case rendering will target the default framebuffer of whichever surface is current when the scenegraph renders.
size
must still be valid, specifying the dimensions of the surface.
注意
This function only has an effect when using the default OpenGL scene graph adaptation.
警告
This function can only be called from the thread doing the rendering.
PySide2.QtQuick.QQuickWindow.
setSceneGraphBackend
(
backend
)
¶
backend – unicode
PySide2.QtQuick.QQuickWindow.
setTextRenderType
(
renderType
)
¶
renderType
–
TextRenderType
Sets the default render type of text-like elements in Qt Quick to
renderType
.
注意
setting the render type will only affect elements created afterwards; the render type of existing elements will not be modified.
另请参阅
PySide2.QtQuick.QQuickWindow.
textRenderType
(
)
¶
Returns the render type of text-like elements in Qt Quick. The default is
QtTextRendering
.
另请参阅