Commit 8bc98115 authored by Cory Quammen's avatar Cory Quammen

Make enum values consistent

Make pqDoubleLineEdit::RealNumberNotation enum values consistent with
those for vtkPVGeneralSettings enum values representing the same
notation. Also, re-order the enum options in settings.xml so that
Fixed and Scientific options are in the same order as
AnimationTimeNotation.
parent f7dee0cc
......@@ -373,15 +373,16 @@
<IntVectorProperty name="RealNumberDisplayedNotation"
number_of_elements="1"
default_values="0"
default_values="2"
command="SetRealNumberDisplayedNotation"
panel_visibility="advanced">
<Documentation>
Set the notation used to display real numbers.
</Documentation>
<EnumerationDomain name="enum">
<Entry text="Fixed" value="0" />
<!-- Reserved for a possible future "Mixed" mode (value="0") -->
<Entry text="Scientific" value="1" />
<Entry text="Fixed" value="2" />
</EnumerationDomain>
</IntVectorProperty>
......
......@@ -201,8 +201,8 @@ public:
*/
enum
{
DISPLAY_REALNUMBERS_USING_FIXED_NOTATION = 0,
DISPLAY_REALNUMBERS_USING_SCIENTIFIC_NOTATION
DISPLAY_REALNUMBERS_USING_SCIENTIFIC_NOTATION = 1,
DISPLAY_REALNUMBERS_USING_FIXED_NOTATION,
};
/**
* Get/Set the notation of real number displayed in widgets or views.
......
......@@ -40,7 +40,7 @@ namespace
//-----------------------------------------------------------------------------
QTextStream::RealNumberNotation toTextStreamNotation(pqDoubleLineEdit::RealNumberNotation notation)
{
if (notation == pqDoubleLineEdit::StandardNotation)
if (notation == pqDoubleLineEdit::FixedNotation)
{
return QTextStream::FixedNotation;
}
......@@ -53,7 +53,14 @@ QTextStream::RealNumberNotation toTextStreamNotation(pqDoubleLineEdit::RealNumbe
//-----------------------------------------------------------------------------
QDoubleValidator::Notation toValidatorNotation(pqDoubleLineEdit::RealNumberNotation notation)
{
return static_cast<QDoubleValidator::Notation>(notation);
if (notation == pqDoubleLineEdit::RealNumberNotation::ScientificNotation)
{
return QDoubleValidator::ScientificNotation;
}
else
{
return QDoubleValidator::StandardNotation;
}
}
}
......@@ -65,7 +72,7 @@ pqDoubleLineEdit::pqDoubleLineEdit(QWidget* _parent)
{
this->DoubleValidator = new QDoubleValidator(this);
this->setValidator(this->DoubleValidator);
this->setNotation(pqDoubleLineEdit::StandardNotation);
this->setNotation(pqDoubleLineEdit::FixedNotation);
}
//-----------------------------------------------------------------------------
......
......@@ -75,8 +75,8 @@ public:
*/
enum RealNumberNotation
{
StandardNotation = 0,
ScientificNotation,
ScientificNotation = 1,
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