mirror of https://github.com/CGAL/cgal
fix DoubleEdit with Qt6
- let the user add as many digits as wanted (using -1 in setRange) - use standard notation, not scientific (which was the default) - comment QDoubleValidator::fixup that for some reason blocks the edition of the field
This commit is contained in:
parent
642ea59de7
commit
1ca77d32af
|
|
@ -9,13 +9,14 @@ 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
|
||||
{
|
||||
|
|
@ -59,7 +60,7 @@ public:
|
|||
|
||||
void DoubleEdit::setRange(double rmin, double rmax)
|
||||
{
|
||||
this->validator->setRange(rmin, rmax, this->validator->decimals());
|
||||
this->validator->setRange(rmin, rmax, -1);
|
||||
}
|
||||
|
||||
double DoubleEdit::getValue()
|
||||
|
|
|
|||
Loading…
Reference in New Issue