QAbstractTextureImage that can be written through a
QPainter . More…
QPaintedTextureImage provides a way to specify a texture image (and thus an OpenGL texture) through a
QPainter . The width and height of the texture image can be specified through the width and height or size properties.
QPaintedTextureImage must be subclassed and the virtual
paint() function implemented. Each time
update() is called on the
QPaintedTextureImage , the
paint() function is invoked and the resulting image is uploaded.
QPaintedTextureImage must be attached to some
- class PySide6.Qt3DRender.Qt3DRender.QPaintedTextureImage([parent=None])¶
w – int
Paints the texture image with the specified
QPainter considers the top-left corner of an image as its origin, while OpenGL considers the bottom-left corner of a texture as its origin. An easy way to account for this difference is to set a custom viewport on the painter before doing any other painting:
painter->setViewport(0, height(), width(), -height()); ...
h – int
Sets the height (
h) of the texture image. Triggers an update, if the size changes.
Sets the width and height of the texture image. Triggers an update, if the
w – int
Sets the width (
w) of the texture image. Triggers an update, if the size changes.
- Return type
Immediately triggers the painted texture’s
paint() function, which in turn uploads the new image to the GPU. If you are making multiple changes to a painted texture, consider waiting until all changes are complete before calling update, in order to minimize the number of repaints required.
rect is currently unused.
w – int
© 2021 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.