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
#1071 - sketch validation problem
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_WidgetIntValue.cpp
diff --git
a/src/ModuleBase/ModuleBase_WidgetIntValue.cpp
b/src/ModuleBase/ModuleBase_WidgetIntValue.cpp
index a0daa71242513af0ac539389b139ae940af8a584..b92d5863f3a3d71ac9ac852bf6afcbe7a8b0bce9 100644
(file)
--- a/
src/ModuleBase/ModuleBase_WidgetIntValue.cpp
+++ b/
src/ModuleBase/ModuleBase_WidgetIntValue.cpp
@@
-1,12
+1,13
@@
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-// File: ModuleBase_Widget
s.h
+// File: ModuleBase_Widget
IntValue.cpp
// Created: 04 June 2014
// Author: Vitaly Smetannikov
#include <ModuleBase_WidgetIntValue.h>
#include <ModuleBase_ParamSpinBox.h>
#include <ModuleBase_Tools.h>
// Created: 04 June 2014
// Author: Vitaly Smetannikov
#include <ModuleBase_WidgetIntValue.h>
#include <ModuleBase_ParamSpinBox.h>
#include <ModuleBase_Tools.h>
+#include <ModuleBase_IntSpinBox.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_AttributeInteger.h>
#include <ModelAPI_Data.h>
@@
-22,7
+23,6
@@
#include <QLabel>
#include <QEvent>
#include <QTimer>
#include <QLabel>
#include <QEvent>
#include <QTimer>
-#include <QSpinBox>
#include <math.h>
#include <math.h>
@@
-48,7
+48,7
@@
ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent,
if (!aLabelIcon.isEmpty())
myLabel->setPixmap(QPixmap(aLabelIcon));
if (!aLabelIcon.isEmpty())
myLabel->setPixmap(QPixmap(aLabelIcon));
- mySpinBox = new
Q
SpinBox(this);
+ mySpinBox = new
ModuleBase_Int
SpinBox(this);
QString anObjName = QString::fromStdString(attributeID());
mySpinBox->setObjectName(anObjName);
QString anObjName = QString::fromStdString(attributeID());
mySpinBox->setObjectName(anObjName);
@@
-82,16
+82,17
@@
ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent,
QString aTTip = QString::fromStdString(theData->widgetTooltip());
mySpinBox->setToolTip(aTTip);
QString aTTip = QString::fromStdString(theData->widgetTooltip());
mySpinBox->setToolTip(aTTip);
+ myLabel->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
aControlLay->addRow(myLabel, mySpinBox);
- connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(values
Chang
ed()));
+ connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(values
Modifi
ed()));
}
ModuleBase_WidgetIntValue::~ModuleBase_WidgetIntValue()
{
}
}
ModuleBase_WidgetIntValue::~ModuleBase_WidgetIntValue()
{
}
-bool ModuleBase_WidgetIntValue::reset()
+bool ModuleBase_WidgetIntValue::reset
Custom
()
{
bool aDone = false;
if (!isUseReset() || isComputedDefault()) {
{
bool aDone = false;
if (!isUseReset() || isComputedDefault()) {
@@
-122,7
+123,7
@@
bool ModuleBase_WidgetIntValue::storeValueCustom() const
return true;
}
return true;
}
-bool ModuleBase_WidgetIntValue::restoreValue()
+bool ModuleBase_WidgetIntValue::restoreValue
Custom
()
{
DataPtr aData = myFeature->data();
AttributeIntegerPtr aRef = aData->integer(attributeID());
{
DataPtr aData = myFeature->data();
AttributeIntegerPtr aRef = aData->integer(attributeID());
@@
-138,3
+139,14
@@
QList<QWidget*> ModuleBase_WidgetIntValue::getControls() const
aList.append(mySpinBox);
return aList;
}
aList.append(mySpinBox);
return aList;
}
+
+bool ModuleBase_WidgetIntValue::processEnter()
+{
+ bool isModified = mySpinBox->isModified();
+ if (isModified) {
+ emit valuesChanged();
+ mySpinBox->clearModified();
+ mySpinBox->selectAll();
+ }
+ return isModified;
+}