Commit 7844fdab authored by Shawn Waldon's avatar Shawn Waldon

Add support for displaying real numbers in 'Mixed' mode

Works similar to printfs %g format specifier.  Fixes #18483.
parent e1ecf860
......@@ -380,7 +380,7 @@
Set the notation used to display real numbers.
</Documentation>
<EnumerationDomain name="enum">
<!-- Reserved for a possible future "Mixed" mode (value="0") -->
<Entry text="Mixed" value="0" />
<Entry text="Scientific" value="1" />
<Entry text="Fixed" value="2" />
</EnumerationDomain>
......
......@@ -45,16 +45,20 @@ QTextStream::RealNumberNotation toTextStreamNotation(pqDoubleLineEdit::RealNumbe
{
return QTextStream::FixedNotation;
}
else
else if (notation == pqDoubleLineEdit::ScientificNotation)
{
return QTextStream::ScientificNotation;
}
else
{
return QTextStream::SmartNotation;
}
}
//-----------------------------------------------------------------------------
QDoubleValidator::Notation toValidatorNotation(pqDoubleLineEdit::RealNumberNotation notation)
{
if (notation == pqDoubleLineEdit::RealNumberNotation::ScientificNotation)
if (notation != pqDoubleLineEdit::RealNumberNotation::FixedNotation)
{
return QDoubleValidator::ScientificNotation;
}
......
......@@ -74,7 +74,8 @@ public:
*/
enum RealNumberNotation
{
ScientificNotation = 1,
MixedNotation = 0,
ScientificNotation,
FixedNotation
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment