import QtQuick 2.12 import QtQuick.Controls 2.12 // Toutes les valeurs ci-dessous sont des valeurs par défaut qui passent à peu près partout. // Mais elles peuvent toutes êtes overridées lors de l'appel de la forme : // // Shipheart_formulaire_textfield { // text: libelle // placeholderText: qsTr("truc bidule") // anchors.left: label.right // width: parent.width - label.width - anchors.leftMargin // ... etc... // } TextField { id: formulaire_textfield property bool flag_num_only: false property bool password_type: false anchors { verticalCenter: parent.verticalCenter } leftPadding: 10 horizontalAlignment: Text.AlignLeft width: parent.width height: parent.height - 10 placeholderText: "" inputMethodHints: flag_num_only ? Qt.ImhDigitsOnly : Qt.ImhNone // Affiche les chiffres et le '.' mais pas les signes (notamment, impossible d'entrer '-') // inputMethodHints: flag_num_only ? Qt.ImhFormattedNumbersOnly : Qt.ImhNone // inputMethodHints: flag_num_only ? Qt.ImhPreferNumbers : Qt.ImhNone // Affiche les chiffres et les signes, y compris '-' font.pixelSize: 18 color: couleur_blanc_casse font.family: shipheart_font_saisie_textfield font.letterSpacing: password_type ? 5.0 : 1.0 // Evite que les points (en mode pwd) soient collés les uns aux autres echoMode: password_type ? TextInput.Password : TextInput.Normal passwordMaskDelay: 1000 // passwordCharacter: "=" text: "" background: Rectangle { color: shipheart_couleur_fond_bouton radius: shipheart_rayon_bouton } onAccepted: { // console.log("Saisie du Textfield avec valeur = [" + text + "]"); } }