]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correction of a distance restart operation. Some code corrections.
authornds <nds@opencascade.com>
Wed, 3 Feb 2016 11:15:40 +0000 (14:15 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:35 +0000 (17:04 +0300)
src/ModuleBase/ModuleBase_DoubleSpinBox.cpp
src/ModuleBase/ModuleBase_DoubleSpinBox.h
src/ModuleBase/ModuleBase_WidgetEditor.cpp
src/ModuleBase/ModuleBase_WidgetEditor.h

index 851a74834d659b00d26f77acbe345396c217c0d6..dba8c5d0f22aec40deef9ddff35ad64c8fd30f56 100644 (file)
@@ -200,24 +200,18 @@ QString ModuleBase_DoubleSpinBox::removeTrailingZeroes(const QString& src) const
 
 void ModuleBase_DoubleSpinBox::keyPressEvent(QKeyEvent* theEvent)
 {
-  bool isEmitKeyRelease = false;
   switch (theEvent->key()) {
     case Qt::Key_Enter:
     case Qt::Key_Return: {
       // do not react to the Enter key, the property panel processes it
       if (!myIsEmitKeyPressEvent)
         return;
-      else
-        isEmitKeyRelease = true;
     }
     break;
     default:
       break;
   }
   QDoubleSpinBox::keyPressEvent(theEvent);
-
-  if (isEmitKeyRelease)
-    emit enterPressed();
 }
 
 void ModuleBase_DoubleSpinBox::keyReleaseEvent(QKeyEvent* theEvent)
index ec18e3500d8306cc7ab04221f5770bb1fd3f9c1e..4fbdbccb28be007daeaabf74700555308b7eff5e 100644 (file)
@@ -57,7 +57,6 @@ Q_OBJECT
 signals:
   /// The signal about key release on the control, that corresponds to the attribute
   /// \param theEvent key release event
-  void enterPressed();
   void enterReleased();
 
  protected slots:
index 08086481bd525018bd6447b3b3559bfef6cbca19..41ec508e2a08183e489992dd97107f6d718d4934 100644 (file)
@@ -36,7 +36,6 @@ ModuleBase_WidgetEditor::ModuleBase_WidgetEditor(QWidget* theParent,
                                                  const Config_WidgetAPI* theData,
                                                  const std::string& theParentId)
 : ModuleBase_WidgetDoubleValue(theParent, theData, theParentId),
-  //myIsEnterPressedEmitted(false),
   myXPosition(-1), myYPosition(-1)
 {
 }
@@ -53,9 +52,6 @@ void ModuleBase_WidgetEditor::editedValue(double& outValue, QString& outText)
 
   ModuleBase_ParamSpinBox* anEditor = new ModuleBase_ParamSpinBox(&aDlg);
   anEditor->enableKeyPressEvent(true);
-  //if (!myIsEditing) {
-  //  connect(anEditor, SIGNAL(enterPressed()), this, SLOT(onEnterPressed()));
-  //}
 
   anEditor->setMinimum(0);
   anEditor->setMaximum(DBL_MAX);
@@ -77,10 +73,6 @@ void ModuleBase_WidgetEditor::editedValue(double& outValue, QString& outText)
   aDlg.move(aPoint);
   aDlg.exec();
 
-  //if (!myIsEditing) {
-  //  disconnect(anEditor, SIGNAL(keyReleased(QKeyEvent*)), this, SLOT(onEnterPressed()));
-  //}
-
   outText = anEditor->text();
   bool isDouble;
   double aValue = outText.toDouble(&isDouble);
@@ -98,8 +90,6 @@ bool ModuleBase_WidgetEditor::focusTo()
 
 void ModuleBase_WidgetEditor::showPopupEditor(const bool theSendSignals)
 {
-  //myIsEnterPressedEmitted = false;
-
   // we need to emit the focus in event manually in order to save the widget as an active
   // in the property panel before the mouse leave event happens in the viewer. The module
   // ask an active widget and change the feature visualization if the widget is not the current one.
@@ -126,7 +116,6 @@ void ModuleBase_WidgetEditor::showPopupEditor(const bool theSendSignals)
     // it is processed in operation manager
     //emit focusOutWidget(this);
 
-    //if (myIsEnterPressedEmitted)
     if (!myIsEditing)
       emit enterClicked(this);
   }
@@ -134,11 +123,6 @@ void ModuleBase_WidgetEditor::showPopupEditor(const bool theSendSignals)
     storeValue();
 }
 
-/*void ModuleBase_WidgetEditor::onEnterPressed()
-{
-  myIsEnterPressedEmitted = true;
-}*/
-
 void ModuleBase_WidgetEditor::setCursorPosition(const int theX, const int theY)
 {
   myXPosition = theX;
index 063dd2b2b33d56ddf980e940fadcb8662f0ecb55..43d9c099b8421527768fa40848fba5a599d4ad7c 100644 (file)
@@ -50,9 +50,6 @@ Q_OBJECT
 
   void setCursorPosition(const int theX, const int theY);
 
-//protected slots:
-  //void onEnterPressed();
-
 private:
    void editedValue(double& outValue, QString& outText);
 
@@ -63,8 +60,6 @@ private:
    ///< the kinds of possible features
    QStringList myFeatureKinds;  
 
-   //bool myIsEnterPressedEmitted;
-
    int myXPosition, myYPosition;
 };