Changed validators to regexp validators

IntValidator limits to 32bit int (JavaScript limitation) and therefor
the input fields are limited in length.
This commit is contained in:
obscuren 2014-05-13 22:25:05 +02:00
parent 7f94b266c7
commit faa3073625
2 changed files with 5 additions and 4 deletions

View File

@ -61,7 +61,7 @@ Component {
id: txValue id: txValue
width: 200 width: 200
placeholderText: "Amount" placeholderText: "Amount"
validator: IntValidator { } validator: RegExpValidator { regExp: /\d*/ }
onTextChanged: { onTextChanged: {
contractFormReady() contractFormReady()
} }
@ -69,7 +69,7 @@ Component {
TextField { TextField {
id: txGas id: txGas
width: 200 width: 200
validator: IntValidator { } validator: RegExpValidator { regExp: /\d*/ }
placeholderText: "Gas" placeholderText: "Gas"
onTextChanged: { onTextChanged: {
contractFormReady() contractFormReady()
@ -79,7 +79,7 @@ Component {
id: txGasPrice id: txGasPrice
width: 200 width: 200
placeholderText: "Gas price" placeholderText: "Gas price"
validator: IntValidator { } validator: RegExpValidator { regExp: /\d*/ }
onTextChanged: { onTextChanged: {
contractFormReady() contractFormReady()
} }

View File

@ -56,9 +56,10 @@ Component {
} }
TextField { TextField {
id: txSimpleValue id: txSimpleValue
width: 200
placeholderText: "Amount" placeholderText: "Amount"
anchors.rightMargin: 5 anchors.rightMargin: 5
validator: IntValidator { } validator: RegExpValidator { regExp: /\d*/ }
onTextChanged: { checkFormState() } onTextChanged: { checkFormState() }
} }
Button { Button {