Commit 73ffae18 authored by Volker Krause's avatar Volker Krause
Browse files

Add support for PDF417 ticket tokens

Needed in order to eventually render MÁV barcodes.
parent 84ce94e1
Pipeline #76550 passed with stage
in 13 minutes and 18 seconds
......@@ -53,6 +53,8 @@ Ticket::TicketTokenType Ticket::ticketTokenType() const
return Code128;
} else if (d->ticketToken.startsWith(QLatin1String("datamatrix:"), Qt::CaseInsensitive)) {
return DataMatrix;
} else if (d->ticketToken.startsWith(QLatin1String("pdf417"), Qt::CaseInsensitive)) {
return PDF417;
} else if (d->ticketToken.startsWith(QLatin1String("http"), Qt::CaseInsensitive)) {
return Url;
}
......@@ -72,6 +74,11 @@ QString Ticket::ticketTokenData() const
return ticketToken().mid(11);
} else if (d->ticketToken.startsWith(QLatin1String("datamatrix:"), Qt::CaseInsensitive)) {
return ticketToken().mid(11);
} else if (d->ticketToken.startsWith(QLatin1String("pdf417:"), Qt::CaseInsensitive)) {
return ticketToken().mid(7);
} else if (d->ticketToken.startsWith(QLatin1String("pdf417bin:"), Qt::CaseInsensitive)) {
const auto b = QByteArray::fromBase64(d->ticketToken.midRef(10).toLatin1());
return QString::fromLatin1(b.constData(), b.size());
}
return ticketToken();
}
......
......@@ -55,7 +55,8 @@ public:
QRCode, ///< QR code
AztecCode, ///< Aztec code
Code128, ///< Code 128 barcode
DataMatrix ///< A DataMatrix barcode
DataMatrix, ///< A DataMatrix barcode
PDF417, ///< A PDF417 barcode
};
Q_ENUM(TicketTokenType)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment