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: [ "QRCode", "DataMatrix", "Aztec", "Code39", "Code93", "Code128", "PDF417", "EAN13" ] 0028 currentIndex: 3 0029 } 0030 Button { 0031 text: "undef" 0032 onClicked: barcode.barcodeType = undefined 0033 } 0034 } 0035 0036 Prison.Barcode { 0037 id: barcode 0038 Layout.fillWidth: true 0039 Layout.fillHeight: true 0040 content: contentEdit.text 0041 barcodeType: typeCombobox.currentIndex 0042 // foregroundColor: "red" 0043 // backgroundColor: "green" 0044 } 0045 0046 RowLayout { 0047 Label { 0048 text: "1D: " + (barcode.dimensions == Prison.Barcode.OneDimension) 0049 } 0050 Label { 0051 text: "2D: " + (barcode.dimensions == 2) 0052 } 0053 Label { 0054 text: "Min size: " + barcode.minimumWidth + "x" + barcode.minimumHeight 0055 } 0056 } 0057 Prison.Barcode { 0058 id: nullbarcode 0059 Layout.fillWidth: true 0060 Layout.fillHeight: true 0061 content: contentEdit.text 0062 Component.onCompleted: { 0063 console.log(nullbarcode.barcodeType) 0064 } 0065 } 0066 } 0067 }