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)
virtual ~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 )

靜態公共成員

const QMetaObject staticMetaObject

保護函數

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.

The 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. The destructor is virtual.

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

Paints the texture image with the specified QPainter 對象 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.