QSGSimpleTextureNode¶
The
QSGSimpleTextureNode
class is provided for convenience to easily draw textured content using the QML scene graph. More…
Synopsis¶
Functions¶
def
filtering
()def
ownsTexture
()def
rect
()def
setFiltering
(filtering)def
setOwnsTexture
(owns)def
setRect
(rect)def
setRect
(x, y, w, h)def
setSourceRect
(r)def
setSourceRect
(x, y, w, h)def
setTexture
(texture)def
setTextureCoordinatesTransform
(mode)def
sourceRect
()def
texture
()def
textureCoordinatesTransform
()
Detailed Description¶
Warning
The simple texture node class must have a texture before being added to the scene graph to be rendered.
Warning
This utility class is only functional when running with the OpenGL or software backends of the Qt Quick scenegraph. For a proper cross-platform alternative prefer using
QSGImageNode
viacreateImageNode()
orcreateImageNode()
.
-
class
QSGSimpleTextureNode
¶ Constructs a new simple texture node
-
PySide2.QtQuick.QSGSimpleTextureNode.
TextureCoordinatesTransformFlag
¶ The enum is used to specify the mode used to generate texture coordinates for a textured quad.
Constant
Description
QSGSimpleTextureNode.NoTransform
Texture coordinates are oriented with window coordinates i.e. with origin at top-left.
QSGSimpleTextureNode.MirrorHorizontally
Texture coordinates are inverted in the horizontal axis with respect to window coordinates
QSGSimpleTextureNode.MirrorVertically
Texture coordinates are inverted in the vertical axis with respect to window coordinates
-
PySide2.QtQuick.QSGSimpleTextureNode.
filtering
()¶ - Return type
Filtering
Returns the filtering currently set on this texture node
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
ownsTexture
()¶ - Return type
bool
Returns
true
if the node takes ownership of the texture; otherwise returnsfalse
.See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
rect
()¶ - Return type
QRectF
Returns the target rect of this texture node.
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setFiltering
(filtering)¶ - Parameters
filtering –
Filtering
Sets the filtering to be used for this texture node to
filtering
.For smooth scaling, use
Linear
; for normal scaling, useNearest
.See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setOwnsTexture
(owns)¶ - Parameters
owns –
bool
Sets whether the node takes ownership of the texture to
owns
.By default, the node does not take ownership of the texture.
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setRect
(rect)¶ - Parameters
rect –
QRectF
Sets the target rect of this texture node to
r
.See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setRect
(x, y, w, h) - Parameters
x –
qreal
y –
qreal
w –
qreal
h –
qreal
This is an overloaded function.
Sets the rectangle of this texture node to begin at (
x
,y
) and have widthw
and heighth
.
-
PySide2.QtQuick.QSGSimpleTextureNode.
setSourceRect
(r)¶ - Parameters
r –
QRectF
Sets the source rect of this texture node to
r
.See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setSourceRect
(x, y, w, h) - Parameters
x –
qreal
y –
qreal
w –
qreal
h –
qreal
This is an overloaded function.
Sets the rectangle of this texture node to show its texture from (
x
,y
) and have widthw
and heighth
relatively to thetextureSize
.
-
PySide2.QtQuick.QSGSimpleTextureNode.
setTexture
(texture)¶ - Parameters
texture –
QSGTexture
Sets the texture of this texture node to
texture
.Use
setOwnsTexture()
to set whether the node should take ownership of the texture. By default, the node does not take ownership.Warning
A texture node must have a texture before being added to the scenegraph to be rendered.
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
setTextureCoordinatesTransform
(mode)¶ - Parameters
mode –
TextureCoordinatesTransformMode
Sets the method used to generate texture coordinates to
mode
. This can be used to obtain correct orientation of the texture. This is commonly needed when using a third party OpenGL library to render to texture as OpenGL has an inverted y-axis relative to Qt Quick.See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
sourceRect
()¶ - Return type
QRectF
Returns the source rect of this texture node.
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
texture
()¶ - Return type
Returns the texture for this texture node
See also
-
PySide2.QtQuick.QSGSimpleTextureNode.
textureCoordinatesTransform
()¶ - Return type
TextureCoordinatesTransformMode
Returns the mode used to generate texture coordinates for this node.
See also
© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.