From 8f137cdc575122acdd9b4120fbbbe5a152561b3f Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 31 Mar 2016 14:49:07 -0300 Subject: [PATCH] Only accept numbers in FactTextEdit All facts are numeric, atm. this means that the input should only accept numbers. it already had the inputMethodHints: Qt.ImhFormattedNumbersOnly option, but for some reason it still accepted letters and symbols. by adding a validator: DoubleValidator {} we limit the characters to numbers only - and if the value is a integer, it will still work. Tested by adding waypoints on the map & messing with the GPS coordinates. Signed-off-by: Tomaz Canabrava --- src/FactSystem/FactControls/FactTextField.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FactSystem/FactControls/FactTextField.qml b/src/FactSystem/FactControls/FactTextField.qml index 525bc3504..1f2707660 100644 --- a/src/FactSystem/FactControls/FactTextField.qml +++ b/src/FactSystem/FactControls/FactTextField.qml @@ -18,8 +18,8 @@ QGCTextField { property Fact fact: null property string _validateString - // At this point all Facts are numeric + validator: DoubleValidator {} inputMethodHints: Qt.ImhFormattedNumbersOnly onEditingFinished: { -- 2.22.0