#include <string>
ExpressionEditor::ExpressionEditor(QWidget* theParent)
-: QPlainTextEdit(theParent), myCompletedAndSelected(false), myIsModified(false)
+: QPlainTextEdit(theParent), myCompletedAndSelected(false)
{
myCompleter = new QCompleter(this);
myCompleter->setWidget(this);
void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent)
{
- bool anIsModified = myIsModified;
-
if (myCompletedAndSelected && handledCompletedAndSelected(theEvent))
return;
myCompletedAndSelected = false;
return myPlaceHolderText;
}
-bool ExpressionEditor::isModified() const
-{
- return myIsModified;
-}
-
-void ExpressionEditor::clearModified()
-{
- myIsModified = false;
-}
-
void ExpressionEditor::paintEvent( QPaintEvent* theEvent )
{
QPlainTextEdit::paintEvent( theEvent );
}
}
-bool ExpressionEditor::focusNextPrevChild(bool theIsNext)
-{
- //emit valueStored();
- //emit focusNextPrev();
- return QPlainTextEdit::focusNextPrevChild(theIsNext);
-}
-
void ExpressionEditor::onTextChanged()
{
- myIsModified = true;
emit valueModified();
}
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*)));
- /// The signal about key release on the control, that corresponds to the attribute
- /// \param theEvent key release event
}
ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor()
bool ModuleBase_WidgetExprEditor::processEnter()
{
- bool isModified = myEditor->isModified();
+ bool isModified = getValueState() == ModifiedInPP;
if (isModified) {
emit valuesChanged();
- myEditor->clearModified();
myEditor->selectAll();
}
return isModified;