QBuffer Class

class Qt3DCore::QBuffer

Provides a data store for raw data to later be used as vertices or uniforms. More...

Header: #include <Qt3DCore/QBuffer>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
Instantiated By: Buffer
Inherits: Qt3DCore::QNode

Public Types

enum AccessType { Write, Read, ReadWrite }
enum UsageType { StreamDraw, StreamRead, StreamCopy, StaticDraw, StaticRead, …, DynamicCopy }

Properties

Public Functions

QBuffer(Qt3DCore::QNode *parent = nullptr)
Qt3DCore::QBuffer::AccessType accessType() const
QByteArray data() const
void setData(const QByteArray &bytes)
void updateData(int offset, const QByteArray &bytes)
Qt3DCore::QBuffer::UsageType usage() const

Public Slots

void setAccessType(Qt3DCore::QBuffer::AccessType access)
void setUsage(Qt3DCore::QBuffer::UsageType usage)

Signals

void accessTypeChanged(Qt3DCore::QBuffer::AccessType access)
void dataAvailable()
void dataChanged(const QByteArray &bytes)
void usageChanged(Qt3DCore::QBuffer::UsageType usage)

Detailed Description

Data can be provided directly using QBuffer::setData().

Member Type Documentation

enum QBuffer::AccessType

ConstantValueDescription
Qt3DCore::QBuffer::Write0x1Write access
Qt3DCore::QBuffer::Read0x2Read access
Qt3DCore::QBuffer::ReadWriteWrite|ReadWrite|Read

enum QBuffer::UsageType

The type of the usage.

ConstantValueDescription
Qt3DCore::QBuffer::StreamDraw0x88E0GL_STREAM_DRAW
Qt3DCore::QBuffer::StreamRead0x88E1GL_STREAM_READ
Qt3DCore::QBuffer::StreamCopy0x88E2GL_STREAM_COPY
Qt3DCore::QBuffer::StaticDraw0x88E4GL_STATIC_DRAW
Qt3DCore::QBuffer::StaticRead0x88E5GL_STATIC_READ
Qt3DCore::QBuffer::StaticCopy0x88E6GL_STATIC_COPY
Qt3DCore::QBuffer::DynamicDraw0x88E8GL_DYNAMIC_DRAW
Qt3DCore::QBuffer::DynamicRead0x88E9GL_DYNAMIC_READ
Qt3DCore::QBuffer::DynamicCopy0x88EAGL_DYNAMIC_COPY

Property Documentation

accessType : AccessType

Returns the AccessType of the buffer.

Access functions:

Qt3DCore::QBuffer::AccessType accessType() const
void setAccessType(Qt3DCore::QBuffer::AccessType access)

Notifier signal:

void accessTypeChanged(Qt3DCore::QBuffer::AccessType access)

See also QBuffer::AccessType.

usage : UsageType

Holds the buffer usage.

Access functions:

Qt3DCore::QBuffer::UsageType usage() const
void setUsage(Qt3DCore::QBuffer::UsageType usage)

Notifier signal:

void usageChanged(Qt3DCore::QBuffer::UsageType usage)

Member Function Documentation

[explicit] QBuffer::QBuffer(Qt3DCore::QNode *parent = nullptr)

Constructs a new QBuffer with parent.

QByteArray QBuffer::data() const

Returns the data.

See also setData().

[signal] void QBuffer::dataAvailable()

This signal is emitted when data becomes available.

[signal] void QBuffer::dataChanged(const QByteArray &bytes)

This signal is emitted with bytes when data changes.

void QBuffer::setData(const QByteArray &bytes)

Sets bytes as data.

See also data().

[invokable] void QBuffer::updateData(int offset, const QByteArray &bytes)

Updates the data by replacing it with bytes at offset.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.