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
Issue #1477 Build Vertex - wrong selection in viewer
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_WidgetExprEditor.cpp
diff --git
a/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
b/src/ModuleBase/ModuleBase_WidgetExprEditor.cpp
index 431a387f8d69c83bae09a9b73db7db1ad61b6e77..ed22ac55f76d1a41cc0e30a1c8bb15c4acb7ddcf 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;
@@
-137,7
+135,7
@@
void ExpressionEditor::keyPressEvent(QKeyEvent* theEvent)
switch (theEvent->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
switch (theEvent->key()) {
case Qt::Key_Enter:
case Qt::Key_Return:
- emit keyReleased(theEvent);
+ emit keyReleased(th
is, th
eEvent);
// do not react to the Enter key, the property panel processes it
return;
break;
// do not react to the Enter key, the property panel processes it
return;
break;
@@
-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 );
@@
-214,16
+202,14
@@
void ExpressionEditor::paintEvent( QPaintEvent* theEvent )
void ExpressionEditor::onTextChanged()
{
void ExpressionEditor::onTextChanged()
{
- myIsModified = true;
emit valueModified();
}
ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent,
const Config_WidgetAPI* theData,
emit valueModified();
}
ModuleBase_WidgetExprEditor::ModuleBase_WidgetExprEditor( QWidget* theParent,
const Config_WidgetAPI* theData,
- const std::string& theParentId,
const std::string& thePlaceHolder )
const std::string& thePlaceHolder )
-
: ModuleBase_ModelWidget(theParent, theData, theParentId
)
+
: ModuleBase_ModelWidget(theParent, theData
)
{
QVBoxLayout* aMainLay = new QVBoxLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
{
QVBoxLayout* aMainLay = new QVBoxLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
@@
-241,18
+227,28
@@
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(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*)));
+ connect(myEditor, SIGNAL(keyReleased(QObject*, QKeyEvent*)),
+ this, SIGNAL(keyReleased(QObject*, QKeyEvent*)));
}
ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor()
{
}
}
ModuleBase_WidgetExprEditor::~ModuleBase_WidgetExprEditor()
{
}
+void ModuleBase_WidgetExprEditor::activateCustom()
+{
+ ModuleBase_ModelWidget::activateCustom();
+
+ QStringList aParameters;
+ ModuleBase_Tools::getParameters(aParameters);
+ myEditor->setCompletionList(aParameters);
+}
+
void ModuleBase_WidgetExprEditor::initializeValueByActivate()
{
}
void ModuleBase_WidgetExprEditor::initializeValueByActivate()
{
}
-bool ModuleBase_WidgetExprEditor::storeValueCustom()
const
+bool ModuleBase_WidgetExprEditor::storeValueCustom()
{
// A rare case when plugin was not loaded.
if(!myFeature)
{
// A rare case when plugin was not loaded.
if(!myFeature)
@@
-314,11
+310,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();
bool isModified = getValueState() == ModifiedInPP;
if (isModified) {
emit valuesChanged();
- //myEditor->clearModified();
myEditor->selectAll();
}
return isModified;
myEditor->selectAll();
}
return isModified;