Historty: DoubleValidator applied to "amount filter" fields

This commit is contained in:
Ilya Kitaev 2016-11-06 18:03:32 +03:00
parent 68736ab834
commit ead7ac8686

View File

@ -229,10 +229,12 @@ Rectangle {
model.paymentIdFilter = paymentIdLine.text model.paymentIdFilter = paymentIdLine.text
model.dateFromFilter = fromDatePicker.currentDate model.dateFromFilter = fromDatePicker.currentDate
model.dateToFilter = toDatePicker.currentDate model.dateToFilter = toDatePicker.currentDate
if (advancedFilteringCheckBox.checked) { if (advancedFilteringCheckBox.checked) {
if (amountFromLine.text.length) { if (amountFromLine.text.length) {
model.amountFromFilter = parseFloat(amountFromLine.text) model.amountFromFilter = parseFloat(amountFromLine.text)
} }
if (amountToLine.text.length) { if (amountToLine.text.length) {
model.amountToFilter = parseFloat(amountToLine.text) model.amountToFilter = parseFloat(amountToLine.text)
} }
@ -243,7 +245,6 @@ Rectangle {
} }
selectedAmount.text = getSelectedAmount() selectedAmount.text = getSelectedAmount()
} }
} }
@ -315,6 +316,15 @@ Rectangle {
anchors.leftMargin: 17 anchors.leftMargin: 17
anchors.topMargin: 5 anchors.topMargin: 5
width: 156 width: 156
validator: DoubleValidator {
locale: "C"
notation: DoubleValidator.StandardNotation
bottom: 0.0
top: {
console.log("top");
parseFloat(amountToLine.text)
}
}
} }
Label { Label {
@ -336,6 +346,15 @@ Rectangle {
anchors.leftMargin: 17 anchors.leftMargin: 17
anchors.topMargin: 5 anchors.topMargin: 5
width: 156 width: 156
validator: DoubleValidator {
locale: "C"
notation: DoubleValidator.StandardNotation
bottom: {
console.log("Botton")
parseFloat(amountFromLine.text)
}
}
} }
Item { Item {