Warning, /libraries/kirigami-addons/tests/TestTextFieldDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2023 Louis Schul <schul9louis@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.5
0008 import QtQuick.Layouts 1.1
0009 import QtQuick.Controls 2.1 as QQC2
0010 import org.kde.kirigami 2.5 as Kirigami
0011 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0012 
0013 Kirigami.ApplicationWindow {
0014     title: "TextFieldDelegate Test"
0015     pageStack.initialPage: textFieldPage
0016 
0017     Component {
0018         id: textFieldPage
0019         Kirigami.Page {
0020             Kirigami.FormLayout {
0021                 anchors.fill: parent
0022 
0023                 FormCard.FormTextFieldDelegate {
0024                     label: "No limits!"
0025                     text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse non diam eros. Aliquam nisi justo, pretium id rhoncus sit amet, fringilla non ipsum."
0026                 }
0027                 FormCard.FormTextFieldDelegate {
0028                     id: overloadField
0029                     label: "Sorry, you must be under 20"
0030                     text: "Perfect, I am 18 !"
0031                     maximumLength: 20
0032                 }
0033                 FormCard.FormTextFieldDelegate {
0034                     label: "No more than 10!"
0035                     text: "The limit!"
0036                     maximumLength: 10
0037                 }
0038                 FormCard.FormTextFieldDelegate {
0039                     label: fieldActiveFocus ? "I am active!" : "I am inactive"
0040                     text: "Focus me"
0041                 }
0042                 QQC2.Button {
0043                     Layout.fillWidth: true
0044                     text: "Force long text in second field"
0045                     onClicked: overloadField.text = "Some very long text that's way longer than 20"
0046                 }
0047             }
0048         }
0049     }
0050 }