Warning, /frameworks/prison/tests/barcode.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003
0004 SPDX-License-Identifier: MIT
0005 */
0006
0007 import QtQuick 2.0
0008 import QtQuick.Controls 2.0
0009 import QtQuick.Layouts 1.0
0010 import org.kde.prison 1.0 as Prison
0011 Rectangle {
0012 width: 640
0013 height: 320
0014 color: "lightsteelblue"
0015 ColumnLayout {
0016 anchors.fill: parent
0017
0018 RowLayout {
0019 Layout.fillWidth: true
0020 TextField {
0021 id: contentEdit
0022 Layout.fillWidth: true
0023 text: "KF5::Prison - The KDE barcode generation framework."
0024 }
0025 ComboBox {
0026 id: typeCombobox
0027 model: [ "Null", "QRCode", "DataMatrix", "Aztec", "Code39", "Code93", "Code128", "PDF417", "EAN13" ]
0028 currentIndex: 3
0029 }
0030 }
0031
0032 Prison.Barcode {
0033 id: barcode
0034 Layout.fillWidth: true
0035 Layout.fillHeight: true
0036 content: contentEdit.text
0037 barcodeType: typeCombobox.currentIndex
0038 // foregroundColor: "red"
0039 // backgroundColor: "green"
0040 }
0041
0042 RowLayout {
0043 Label {
0044 text: "1D: " + (barcode.dimensions == Prison.Barcode.OneDimension)
0045 }
0046 Label {
0047 text: "2D: " + (barcode.dimensions == 2)
0048 }
0049 Label {
0050 text: "Min size: " + barcode.minimumWidth + "x" + barcode.minimumHeight
0051 }
0052 }
0053 }
0054 }