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
Correct compilation on Linux.
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_WidgetExprEditor.cpp
diff --git
a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
index 3e040c4d39e6a7a32c9df3ab58c697c141cb3300..c0e683f89751ae8fd1da7e52c00b5059919ba923 100644
(file)
--- a/
src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
+++ b/
src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
@@
-36,7
+36,7
@@
#include <string>
ExpressionEditor::ExpressionEditor(QWidget* theParent)
#include <string>
ExpressionEditor::ExpressionEditor(QWidget* theParent)
-: QPlainTextEdit(theParent), myCompletedAndSelected(false)
, myIsModified(false)
+: QPlainTextEdit(theParent), myCompletedAndSelected(false)
{
myCompleter = new QCompleter(this);
myCompleter->setWidget(this);
{
myCompleter = new QCompleter(this);
myCompleter->setWidget(this);
@@
-114,8
+114,6
@@
void ExpressionEditor::performCompletion(const QString& theCompletionPrefix)
void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent)
{
void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent)
{
- bool anIsModified = myIsModified;
-
if (myCompletedAndSelected && handledCompletedAndSelected(theEvent))
return;
myCompletedAndSelected = false;
if (myCompletedAndSelected && handledCompletedAndSelected(theEvent))
return;
myCompletedAndSelected = false;
@@
-173,16
+171,6
@@
QString ExpressionEditor::placeHolderText() const
return myPlaceHolderText;
}
return myPlaceHolderText;
}
-bool ExpressionEditor::isModified() const
-{
- return myIsModified;
-}
-
-void ExpressionEditor::clearModified()
-{
- myIsModified = false;
-}
-
void ExpressionEditor::paintEvent( QPaintEvent* theEvent )
{
QPlainTextEdit::paintEvent( theEvent );
void ExpressionEditor::paintEvent( QPaintEvent* theEvent )
{
QPlainTextEdit::paintEvent( theEvent );
@@
-212,16
+200,8
@@
void ExpressionEditor::paintEvent( QPaintEvent* theEvent )
}
}
}
}
-bool ExpressionEditor::focusNextPrevChild(bool theIsNext)
-{
- emit valueStored();
- emit focusNextPrev();
- return QPlainTextEdit::focusNextPrevChild(theIsNext);
-}
-
void ExpressionEditor::onTextChanged()
{
void ExpressionEditor::onTextChanged()
{
- myIsModified = true;
emit valueModified();
}
emit valueModified();
}
@@
-248,12
+228,7
@@
ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent,
this->setLayout(aMainLay);
connect(myEditor, SIGNAL(valueModified()), this, SIGNAL(valuesModified()));
this->setLayout(aMainLay);
connect(myEditor, SIGNAL(valueModified()), this, SIGNAL(valuesModified()));
- connect(myEditor, SIGNAL(valueStored()), this, SLOT(onTextChanged()));
- connect(myEditor, SIGNAL(focusNextPrev()), this, SIGNAL(focusNextPrev()));
-
connect(myEditor, SIGNAL(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*)));
connect(myEditor, SIGNAL(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*)));
- /// The signal about key release on the control, that corresponds to the attribute
- /// \param theEvent key release event
}
ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor()
}
ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor()
@@
-326,10
+301,9
@@
QList<QWidget*> ModuleBase_WidgetExprEditor::getControls() const
bool ModuleBase_WidgetExprEditor::processEnter()
{
bool ModuleBase_WidgetExprEditor::processEnter()
{
- bool isModified =
myEditor->isModified()
;
+ bool isModified =
getValueState() == ModifiedInPP
;
if (isModified) {
emit valuesChanged();
if (isModified) {
emit valuesChanged();
- myEditor->clearModified();
myEditor->selectAll();
}
return isModified;
myEditor->selectAll();
}
return isModified;