SLOT(onTextChanged( const QString& )));
connect(this, SIGNAL(valueChanged(const QString&)), this, SLOT(onValueChanged(const QString&)));
- //connect(this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
}
/*!
myIsModified = true;
}
-void ModuleBase_DoubleSpinBox::onEditingFinished()
-{
- //myIsModified = false;
-}
-
bool ModuleBase_DoubleSpinBox::isModified() const
{
return myIsModified;
/// Called on text changed
virtual void onTextChanged(const QString&);
void onValueChanged(const QString& theValue);
- void onEditingFinished();
protected:
/// Removes extra trailing zero symbols
#include <QDebug>
#endif
-#define APPLY_BY_ENTER_OR_TAB
-
ModuleBase_OperationFeature::ModuleBase_OperationFeature(const QString& theId, QObject* theParent)
: ModuleBase_Operation(theId, theParent),
myIsEditing(false)
// changed.
ModuleBase_IPropertyPanel* aPropertyPanel = propertyPanel();
if (aPropertyPanel) {
-#ifdef APPLY_BY_ENTER_OR_TAB
ModuleBase_ModelWidget* aWidget = aPropertyPanel->activeWidget();
if (aWidget)
aWidget->storeValueByApply();
-#endif
aPropertyPanel->cleanContent();
}
SessionPtr aMgr = ModelAPI_Session::get();
#include <iostream>
#endif
-#define APPLY_BY_ENTER_OR_TAB
-
ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
const Config_WidgetAPI* theData,
const std::string& theParentId)
mySpinBox->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
-#ifdef APPLY_BY_ENTER_OR_TAB
// Apply widget value change by enter/tab event.
- //connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueStored()), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
connect(mySpinBox, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
-
-#else
- connect(mySpinBox, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesChanged()));
-#endif
}
ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue()
bool ExpressionEditor::focusNextPrevChild(bool theIsNext)
{
- if (myIsModified)
- emit editingFinished();
emit valueStored();
emit focusNextPrev();
return QPlainTextEdit::focusNextPrevChild(theIsNext);
this->setLayout(aMainLay);
connect(myEditor, SIGNAL(valueModified()), this, SIGNAL(valuesModified()));
- //connect(myEditor, SIGNAL(editingFinished()), this, SLOT(onTextChanged()));
connect(myEditor, SIGNAL(valueStored()), this, SLOT(onTextChanged()));
connect(myEditor, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
void onTextChanged();
signals:
- void editingFinished();
void valueModified();
/// A signal that is emitted by the "Tab" key event. It is emitted before the key is processed.
void valueStored();
#include <iostream>
#endif
-#define APPLY_BY_ENTER_OR_TAB
-
ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent,
const Config_WidgetAPI* theData,
const std::string& theParentId)
mySpinBox->setToolTip(aTTip);
aControlLay->addRow(myLabel, mySpinBox);
-#ifdef APPLY_BY_ENTER_OR_TAB
// Apply widget value change by enter/tab event.
- connect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
+ connect(mySpinBox, SIGNAL(valueStored()), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valuesModified()));
-#else
- connect(mySpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valuesChanged()));
-#endif
+ connect(mySpinBox, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
}
ModuleBase_WidgetIntValue::~ModuleBase_WidgetIntValue()
static QStringList MyFeaturesForCoincedence;
-#define APPLY_BY_ENTER_OR_TAB
-
PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
myXSpin->setToolTip(tr("X"));
aGroupLay->addWidget(myXSpin, 0, 1);
-#ifdef APPLY_BY_ENTER_OR_TAB
// Apply widget value change by enter/tab event.
- //connect(myXSpin, SIGNAL(editingFinished()), this, SLOT(onValuesChanged()));
- //connect(myXSpin, SIGNAL(focusNextPrev()), this, SLOT(onValuesChanged()));
connect(myXSpin, SIGNAL(valueStored()), this, SLOT(onValuesChanged()));
connect(myXSpin, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
connect(myXSpin, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
-#else
- connect(myXSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged()));
-#endif
}
{
QLabel* aLabel = new QLabel(myGroupBox);
myYSpin->setToolTip(tr("Y"));
aGroupLay->addWidget(myYSpin, 1, 1);
-#ifdef APPLY_BY_ENTER_OR_TAB
// Apply widget value change by enter/tab event.
- //connect(myYSpin, SIGNAL(editingFinished()), this, SLOT(onValuesChanged()));
connect(myYSpin, SIGNAL(valueStored()), this, SLOT(onValuesChanged()));
connect(myYSpin, SIGNAL(valueChanged(const QString&)), this, SIGNAL(valuesModified()));
connect(myYSpin, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
-#else
- connect(myYSpin, SIGNAL(valueChanged(const QString&)), this, SLOT(onValuesChanged()));
-#endif
}
QVBoxLayout* aLayout = new QVBoxLayout(this);
ModuleBase_Tools::zeroMargins(aLayout);
#include <QMouseEvent>
-#define APPLY_BY_ENTER_OR_TAB
-
PartSet_WidgetPoint2dDistance::PartSet_WidgetPoint2dDistance(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
const Config_WidgetAPI* theData,
: ModuleBase_WidgetDoubleValue(theParent, theData, theParentId), myWorkshop(theWorkshop)
{
myFirstPntName = theData->getProperty("first_point");
-
- // Reconnect to local slot
-#ifdef APPLY_BY_ENTER_OR_TAB
- // Apply widget value change by enter/tab event.
- //disconnect(mySpinBox, SIGNAL(editingFinished()), this, SIGNAL(valuesChanged()));
- disconnect(mySpinBox, SIGNAL(valueStored()), this, SIGNAL(valuesChanged()));
- connect(mySpinBox, SIGNAL(editingFinished()), this, SLOT(onValuesChanged()));
- connect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesModified()));
-#else
- disconnect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged()));
- connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValuesChanged()));
-#endif
}
PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()
setValueState(ModifiedInViewer);
}
-void PartSet_WidgetPoint2dDistance::onValuesChanged()
-{
- emit valuesChanged();
-}
-
bool PartSet_WidgetPoint2dDistance::processEnter()
{
bool isModified = mySpinBox->isModified();
virtual double computeValue(const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPnt,
const std::shared_ptr<GeomAPI_Pnt2d>& theCurrentPnt);
-private slots:
- /// Process values changed event
- void onValuesChanged();
-
protected:
/// A reference to workshop
ModuleBase_IWorkshop* myWorkshop;