Prison::ScanResult Class
Result of a barcode scan attempt. More...
- Header:
#include <Prison/ScanResult> - CMake:
find_package(KF6 REQUIRED COMPONENTS Prison)
target_link_libraries(mytarget PRIVATE KF6::PrisonScanner) - In QML: scanResult
List of all members, including inherited members
Properties
- [read-only] binaryData : QByteArray
- [read-only] boundingRect : QRect
- [read-only] content : QVariant
- [read-only] format : Prison::Format::BarcodeFormat
- [read-only] hasBinaryData : bool
- [read-only] hasContent : bool
- [read-only] hasText : bool
- [read-only] text : QString
Public Functions
- ScanResult()
- QByteArray binaryData() const
- QRect boundingRect() const
- QVariant content() const
- Prison::Format::BarcodeFormat format() const
- bool hasBinaryData() const
- bool hasContent() const
- bool hasText() const
- QString text() const
- bool ScanResult::operator==(const Prison::ScanResult &other) const
Detailed Description
A scan result consists of the barcode content (which can be text or binary data), the barcode format and the position in the video frame the barcode was detected.
Property Documentation
[read-only] binaryData : QByteArray
Access functions:
QByteArraybinaryData() const
[read-only] boundingRect : QRect
Access functions:
QRectboundingRect() const
[read-only] content : QVariant
Access functions:
QVariantcontent() const
[read-only] format : Prison::Format::BarcodeFormat
Access functions:
Prison::Format::BarcodeFormatformat() const
[read-only] hasBinaryData : bool
Access functions:
boolhasBinaryData() const
[read-only] hasContent : bool
Access functions:
boolhasContent() const
[read-only] hasText : bool
Access functions:
boolhasText() const
[read-only] text : QString
Access functions:
QStringtext() const
Member Function Documentation
[explicit] ScanResult::ScanResult()
QByteArray ScanResult::binaryData() const
Returns the binary data content, if the content was binary data rather than text, otherwise returns an empty QByteArray.
Note: Getter function for property binaryData.
QRect ScanResult::boundingRect() const
The bounding rectangle of the detected barcode in source coordinates.
Note: When using this to display an overlay in a view finder, this needs to be mapped to item coordinates.
Note: Getter function for property boundingRect.
QVariant ScanResult::content() const
The barcode content, either a QString or a QByteArray.
Note: Getter function for property content.
Prison::Format::BarcodeFormat ScanResult::format() const
The format of the detected barcode.
Note: Getter function for property format.
bool ScanResult::hasBinaryData() const
Returns true if the found barcode contained a binary data payload.
Note: Getter function for property hasBinaryData.
bool ScanResult::hasContent() const
Returns true if a barcode has been found.
Note: Getter function for property hasContent.
bool ScanResult::hasText() const
Returns true if the found barcode contained a textual payload.
Note: Getter function for property hasText.
QString ScanResult::text() const
Returns the textual barcode content, if the content was text rather than binary data, otherwise returns an empty string.
Note: Getter function for property text.