C

QSafeBitmapResourceReader Class

class SafeRenderer::QSafeBitmapResourceReader

The QSafeBitmapResourceReader class provides the Qt resource file implementation of QSafeBitmapReader. More...

Header: #include <QSafeBitmapResourceReader>
Inherits: SafeRenderer::QSafeBitmapReader

Public Types

enum BitmapResourceReaderException { TooMany, SizeError, DataCorrupted }

Public Functions

Reimplemented Public Functions

virtual const SafeRenderer::QSafeBitmap *getBitmapByID(const SafeRenderer::quint32 hash) const override
virtual void loadBitmapFile(const SafeRenderer::qchar *const file, const SafeRenderer::quint32 crc) override

Detailed Description

It is possible to link the data structures generated by Qt resource compiler into the Qt Safe Renderer binary. The generated data can be read and accessed using the QSafeBitmapResource class.

Member Type Documentation

enum QSafeBitmapResourceReader::BitmapResourceReaderException

This enum describes exception values of the class QSafeBitmap

ConstantValueDescription
SafeRenderer::QSafeBitmapResourceReader::TooMany0The number of bitmaps exceeds the value defined in SafeRenderer::Constraints::MAXIMUM value.
SafeRenderer::QSafeBitmapResourceReader::SizeError1The bitmap data size does not match the defined width and height.
SafeRenderer::QSafeBitmapResourceReader::DataCorrupted2The read data does not pass a checksum.

Member Function Documentation

QSafeBitmapResourceReader::QSafeBitmapResourceReader()

Constructs a QSafeBitmapResourceReader object.

[override virtual] const SafeRenderer::QSafeBitmap *QSafeBitmapResourceReader::getBitmapByID(const SafeRenderer::quint32 hash) const

Reimplements: QSafeBitmapReader::getBitmapByID(const SafeRenderer::quint32 hash) const.

Returns a pointer to the QSafeBitmap item. The hash value is the hash value of the bitmap file name. The hash can be calculated with qt_hash function.

[override virtual] void QSafeBitmapResourceReader::loadBitmapFile(const SafeRenderer::qchar *const file, const SafeRenderer::quint32 crc)

Reimplements: QSafeBitmapReader::loadBitmapFile(const SafeRenderer::qchar *const file, const SafeRenderer::quint32 crc).

Loads the bitmap file from the Qt resource data structure. The crc is ignored.

For more information about the Qt resource file system, see the QResource class documentation.

Available under certain Qt licenses.
Find out more.