QPaintedTextureImage Class

( Qt3DRender::QPaintedTextureImage )

A QAbstractTextureImage that can be written through a QPainter . 更多...

头: #include <QPaintedTextureImage>
qmake: QT += 3drender
Since: Qt 5.8
继承: Qt3DRender::QAbstractTextureImage

特性

公共函数

QPaintedTextureImage (Qt3DCore::QNode * parent = nullptr)
~QPaintedTextureImage ()
int height () const
QSize size () const
void update (const QRect & rect = QRect())
int width () const

公共槽

void setHeight (int h )
void setSize (QSize size )
void setWidth (int w )

信号

void heightChanged (int w )
void sizeChanged (QSize size )
void widthChanged (int w )

保护函数

virtual void paint (QPainter * painter ) = 0

额外继承成员

详细描述

A QAbstractTextureImage that can be written through a QPainter .

A 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.

A QPaintedTextureImage must be subclassed and the virtual paint () function implemented. Each time update () is called on the QPaintedTextureImage paint () function is invoked and the resulting image is uploaded.

QPaintedTextureImage must be attached to some QAbstractTexture .

特性文档编制

height : int

This property holds the height of the texture image. The height must be greater than or equal to 1.

访问函数:

int height () const
void setHeight (int h )

通知程序信号:

void heightChanged (int w )

size : QSize

This property holds the size of the texture image.

访问函数:

QSize size () const
void setSize (QSize size )

通知程序信号:

void sizeChanged (QSize size )

另请参阅 height and width .

width : int

This property holds the width of the texture image. The width must be greater than or equal to 1.

访问函数:

int width () const
void setWidth (int w )

通知程序信号:

void widthChanged (int w )

成员函数文档编制

QPaintedTextureImage:: QPaintedTextureImage ( Qt3DCore::QNode * parent = nullptr)

Default constructs an instance of QPaintedTextureImage.

QPaintedTextureImage:: ~QPaintedTextureImage ()

Destroys the instance of QPaintedTextureImage.

[pure virtual protected] void QPaintedTextureImage:: paint ( QPainter * painter )

Paints the texture image with the specified QPainter object painter .

[slot] void QPaintedTextureImage:: setHeight ( int h )

Sets the height ( h ) of the texture image. Triggers an update, if the size changes.

注意: Setter 函数对于特性 height .

另请参阅 height ().

[slot] void QPaintedTextureImage:: setSize ( QSize size )

Sets the width and height of the texture image. Triggers an update, if the size 改变。

注意: Setter 函数对于特性 size .

另请参阅 size ().

[slot] void QPaintedTextureImage:: setWidth ( int w )

Sets the width ( w ) of the texture image. Triggers an update, if the size changes.

注意: Setter 函数对于特性 width .

另请参阅 width ().

void QPaintedTextureImage:: update (const QRect & rect = QRect())

Schedules the painted texture's paint () function to be called, which in turn uploads the new image to the GPU. Parameter rect is currently unused.