From 81ec81f411d45b03dfd9d68f8c3f0b45cb304d627b488df8161606677f8330f0 Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Thu, 12 Dec 2024 15:58:30 +0100 Subject: [PATCH] finished AddCustomer Form --- Gui/AddContact.qml | 18 ++++++++++++++++++ Gui/CustomerView.qml | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/Gui/AddContact.qml b/Gui/AddContact.qml index 410ceb4..18303ec 100644 --- a/Gui/AddContact.qml +++ b/Gui/AddContact.qml @@ -74,6 +74,11 @@ GridLayout property string name: "email" id: emailcontact Layout.fillWidth: true + placeholderText: qsTr("beispiel@domain.de") + validator: RegularExpressionValidator + { + regularExpression: /([\+!#$%&‘\*\–\/\=?\^_`\.{|}\~0-9A-Za-z]{1,185})@([0-9A-Za-z\.]{1,64})\.([a-zA-z]{2,5})/ + } } Label @@ -86,6 +91,10 @@ GridLayout property string name: "telephonecontact" id: telephonecontact Layout.fillWidth: true + validator: RegularExpressionValidator + { + regularExpression: /([+0-9]{1})([0-9]{1,17})/ + } } Label @@ -98,6 +107,10 @@ GridLayout property string name: "cellphone" id: cellphone Layout.fillWidth: true + validator: RegularExpressionValidator + { + regularExpression: /([+0-9]{1})([0-9]{1,17})/ + } } Label { @@ -109,6 +122,11 @@ GridLayout property string name: "birthday" id: birthday Layout.fillWidth: true + placeholderText: qsTr("TT.MM.JJJJ") + validator: RegularExpressionValidator + { + regularExpression: /((^|)([0-2]{1}[0-9]{1}|3[0-1]))\.((^|)([0-1]{1,2}|12))\.([0-9]{4})/ + } } Label diff --git a/Gui/CustomerView.qml b/Gui/CustomerView.qml index 943b7ab..d41a62f 100644 --- a/Gui/CustomerView.qml +++ b/Gui/CustomerView.qml @@ -70,6 +70,11 @@ GridLayout popup.y: postcode.y + 5 - (postcode.height * 2) currentIndex: -1 onCurrentIndexChanged: city.currentIndex = postcode.currentIndex + validator: RegularExpressionValidator + { + regularExpression: /([0-9]{1,5})/ + } + } Label @@ -103,6 +108,11 @@ GridLayout property string name: "telephone" id: telephone Layout.fillWidth: true + validator: RegularExpressionValidator + { + regularExpression: /([+0-9]{1})([0-9]{1,17})/ + } + } Label @@ -115,6 +125,10 @@ GridLayout property string name: "cellphone" id: cellphone Layout.fillWidth: true + validator: RegularExpressionValidator + { + regularExpression: /([+0-9]{1})([0-9]{1,17})/ + } } Label @@ -127,6 +141,11 @@ GridLayout property string name: "email" id: email Layout.fillWidth: true + placeholderText: qsTr("beispiel@domain.de") + validator: RegularExpressionValidator + { + regularExpression: /([\+!#$%&‘\*\–\/\=?\^_`\.{|}\~0-9A-Za-z]{1,185})@([0-9A-Za-z\.]{1,64})\.([a-zA-z]{2,5})/ + } } Label @@ -139,6 +158,7 @@ GridLayout property string name: "homepage" id: homepage Layout.fillWidth: true + placeholderText: "www.oschkarischtverhaftetwegensexy.jinx" } Label