Pages
API Documentation
On this page

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

Public Functions

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:

[read-only] boundingRect : QRect

Access functions:

[read-only] content : QVariant

Access functions:

[read-only] format : Prison::Format::BarcodeFormat

Access functions:

  • Prison::Format::BarcodeFormat format() const

[read-only] hasBinaryData : bool

Access functions:

[read-only] hasContent : bool

Access functions:

[read-only] hasText : bool

Access functions:

[read-only] text : QString

Access functions:

  • QString text() 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.

bool ScanResult::operator==(const Prison::ScanResult &other) const

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.