Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rectangle correction to have coincidence with point/line selected for the first point...
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_ParamSpinBox.cpp
diff --git
a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp
b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp
index febd29badbf419cdbf187edbbcf8533742bf04e6..40b50fb1757ff1dca0a7f0dbbe0a3b3f88689685 100644
(file)
--- a/
src/ModuleBase/ModuleBase_ParamSpinBox.cpp
+++ b/
src/ModuleBase/ModuleBase_ParamSpinBox.cpp
@@
-16,19
+16,7
@@
#include <string>
#include <iostream>
#include <string>
#include <iostream>
-/*!
- \class ModuleBase_ParamSpinBox
- */
-
-/*!
- \brief Constructor.
- Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
- a step value of 1.0 and a precision of 2 decimal places.
- The value is initially set to 0.00.
-
- \param parent parent object
- */
ModuleBase_ParamSpinBox::ModuleBase_ParamSpinBox(QWidget* theParent, int thePrecision)
: ModuleBase_DoubleSpinBox(theParent, thePrecision),
myAcceptVariables(true)
ModuleBase_ParamSpinBox::ModuleBase_ParamSpinBox(QWidget* theParent, int thePrecision)
: ModuleBase_DoubleSpinBox(theParent, thePrecision),
myAcceptVariables(true)
@@
-69,26
+57,17
@@
void ModuleBase_ParamSpinBox::connectSignalsAndSlots()
this, SLOT(onTextChanged(const QString&)));
}
this, SLOT(onTextChanged(const QString&)));
}
-/*!
- \brief This function is called when value is changed.
- */
void ModuleBase_ParamSpinBox::onTextChanged(const QString& text)
{
myTextValue = text;
}
void ModuleBase_ParamSpinBox::onTextChanged(const QString& text)
{
myTextValue = text;
}
-/*!
- \brief Interpret text entered by the user as a value.
- \param text text entered by the user
- \return mapped value
- \sa textFromValue()
- */
double ModuleBase_ParamSpinBox::valueFromText(const QString& theText) const
{
if (!hasVariable(theText))
return ModuleBase_DoubleSpinBox::valueFromText(theText);
double ModuleBase_ParamSpinBox::valueFromText(const QString& theText) const
{
if (!hasVariable(theText))
return ModuleBase_DoubleSpinBox::valueFromText(theText);
- // small hack: return
lengt
h of the string to initiate valuesChanged signal
+ // small hack: return
has
h of the string to initiate valuesChanged signal
return qHash(theText);
}
return qHash(theText);
}
@@
-122,9
+101,14
@@
QValidator::State ModuleBase_ParamSpinBox::validate(QString& str, int& pos) cons
/*!
\brief This function is used to set a current value for this spinbox.
\param value current value
/*!
\brief This function is used to set a current value for this spinbox.
\param value current value
+
+ The new value is ignored if the spinbox has a variable.
*/
void ModuleBase_ParamSpinBox::setValue(const double value)
{
*/
void ModuleBase_ParamSpinBox::setValue(const double value)
{
+ if (hasVariable())
+ return;
+
myTextValue = ModuleBase_DoubleSpinBox::textFromValue(value);
ModuleBase_DoubleSpinBox::setValue(value);
}
myTextValue = ModuleBase_DoubleSpinBox::textFromValue(value);
ModuleBase_DoubleSpinBox::setValue(value);
}
@@
-235,7
+219,7
@@
bool ModuleBase_ParamSpinBox::findVariable(const QString& theName,
}
/*!
}
/*!
- \brief This function is called when the spinbox rec
ie
ves key press event.
+ \brief This function is called when the spinbox rec
ei
ves key press event.
*/
//void ModuleBase_ParamSpinBox::keyPressEvent(QKeyEvent* e)
//{
*/
//void ModuleBase_ParamSpinBox::keyPressEvent(QKeyEvent* e)
//{
@@
-247,7
+231,7
@@
bool ModuleBase_ParamSpinBox::findVariable(const QString& theName,
//}
/*!
//}
/*!
- \brief This function is called when the spinbox rec
ie
ves show event.
+ \brief This function is called when the spinbox rec
ei
ves show event.
*/
void ModuleBase_ParamSpinBox::showEvent(QShowEvent* theEvent)
{
*/
void ModuleBase_ParamSpinBox::showEvent(QShowEvent* theEvent)
{