From 3fc14d8d56e4fb2649fc63a5173e8c2042276d54 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 1 Dec 2023 11:22:39 +0100 Subject: [PATCH] use QDoubleValidator::fixup() in DoubleEdit::fixup() with this version the user can write with scientific notation or standard notation, using . or , Note that when input is invalid, value() returns 0 --- Polyhedron/demo/Polyhedron/CGAL_double_edit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/CGAL_double_edit.cpp b/Polyhedron/demo/Polyhedron/CGAL_double_edit.cpp index c452186e1fa..9f6f4c9b5a2 100644 --- a/Polyhedron/demo/Polyhedron/CGAL_double_edit.cpp +++ b/Polyhedron/demo/Polyhedron/CGAL_double_edit.cpp @@ -9,18 +9,16 @@ public: : QDoubleValidator(parent) { setLocale(QLocale::C); - setNotation(QDoubleValidator::StandardNotation); } void fixup ( QString & input ) const { input.replace(".", locale().decimalPoint()); input.replace(",", locale().decimalPoint()); -// QDoubleValidator::fixup(input); + QDoubleValidator::fixup(input); } QValidator::State validate ( QString & input, int & pos ) const { - fixup(input); return QDoubleValidator::validate(input, pos); } };