Purpose
8import QtQuick.Window 2.12
9import QtQuick.Layouts 1.1
10import QtQuick.Controls 2.12 as QQC2
11import org.kde.kirigami 2.12 as Kirigami
13import org.kde.prison 1.0 as Prison
19 property string mimeType
22 Component.onCompleted: {
23 root.Window.window.minimumWidth = Qt.binding(function() {
24 return Math.min(Kirigami.Units.gridUnit * 30,
25 root.implicitWidth + Kirigami.Units.gridUnit * 2);
27 root.Window.window.minimumHeight =
Qt.binding(function() {
28 return Math.min(
Kirigami.Units.gridUnit * 30,
29 root.implicitHeight +
Kirigami.Units.gridUnit * 4);
34 Layout.fillWidth:
true
35 Layout.fillHeight:
true
37 Layout.preferredHeight: barcodeItem.implicitHeight
41 readonly
property bool valid: implicitWidth > 0 && implicitHeight > 0 && implicitWidth <= width && implicitHeight <= height
45 opacity: valid ? 1 : 0
46 content: textField.text
51 horizontalAlignment:
Text.AlignHCenter
52 verticalAlignment:
Text.AlignVCenter
53 text:
i18nd(
"purpose6_barcode",
"Type a URL or some text to generate a QR code")
54 wrapMode: Text.WordWrap
55 visible: textField.length === 0
60 horizontalAlignment:
Text.AlignHCenter
61 verticalAlignment:
Text.AlignVCenter
62 text:
i18nd(
"purpose6_barcode",
"Creating QR code failed")
63 wrapMode: Text.WordWrap
64 visible: textField.length > 0 && barcodeItem.implicitWidth === 0 && barcodeItem.implicitHeight === 0
69 horizontalAlignment:
Text.AlignHCenter
70 verticalAlignment:
Text.AlignVCenter
71 text:
i18nd(
"purpose6_barcode",
"The QR code is too large to be displayed")
72 wrapMode: Text.WordWrap
73 visible: textField.length > 0 && (barcodeItem.implicitWidth > barcodeItem.width || barcodeItem.implicitHeight > barcodeItem.height)
79 Layout.fillWidth:
true
83 placeholderText:
i18nd(
"purpose6_barcode",
"Type a URL or some text...")
84 Component.onCompleted: forceActiveFocus()
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
QString & fill(QChar ch, qsizetype size)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:07:47 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.