|
QBarcode
|
Represent a barcode entity. More...

Public Member Functions | |
| Barcode (Barcode &&other) noexcept | |
| Barcode & | operator= (Barcode &&) noexcept |
| bool | isValid () const |
| Allow to verify if a barcode is valid. | |
| BarType | getType () const |
| Get barcode type. | |
| const Payload * | getPayload () const |
| Get payload data of barcode. | |
| QSize | getSize () const |
| Get matrix size. | |
| const MatrixData & | getMatrixData () const |
| Get matrix data of a barcode. | |
| virtual QSizeF | getRatio () const =0 |
| Retrieve ratio of a barcode. | |
| template<typename T > | |
| const T * | getPayloadAs () const |
| Allow to directly cast payload to expected type. | |
Represent a barcode entity.
This class allow to share common properties/methods accross all kinds of barcodes types.
A barcode entity is considered as immutable, to set it, it will be necessary to generate a new Barcode via their create() method.
Barcode only store data, it known nothing of the rendering process. Once a barcode entity is created, it can be renderer via Renderer derived classes.
| bool qbar::Barcode::isValid | ( | ) | const |
Allow to verify if a barcode is valid.
A barcode is considered valid if:
true if valid. | BarType qbar::Barcode::getType | ( | ) | const |
Get barcode type.
Useful to properly cast a Barcode instance to its "real" type.
| const Payload * qbar::Barcode::getPayload | ( | ) | const |
Get payload data of barcode.
NULL if barcode is invalid.| QSize qbar::Barcode::getSize | ( | ) | const |
Get matrix size.
| const MatrixData & qbar::Barcode::getMatrixData | ( | ) | const |
Get matrix data of a barcode.
Matrix data can be useful if directly managing "raw" datas, mainly used for Renderer derived classes.
|
pure virtual |
Retrieve ratio of a barcode.
Allow to manage different format of barcode, to know if they are taller of wider.
Implemented in qbar::QrCode.
|
inline |
Allow to directly cast payload to expected type.
NULL if barcode is invalid or if casting cannot be done.