]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
NPAL15963 (Problem with option -u (--execute) of runSalome).
authoreap <eap@opencascade.com>
Mon, 21 May 2007 10:16:18 +0000 (10:16 +0000)
committereap <eap@opencascade.com>
Mon, 21 May 2007 10:16:18 +0000 (10:16 +0000)
void PythonConsole_PyEditor::exec( const QString& command )
-  setText( command + "\n" );
-  handleReturn();
+  // Let events creating a study end before script execution starts
+  setText( command /*+ "\n"*/ );
+  //handleReturn();
+  qApp->postEvent( this, new QKeyEvent(QEvent::KeyPress,Key_Return,13,Qt::NoButton ));

src/PythonConsole/PythonConsole_PyEditor.cxx

index c48c534fda00e830b9de7ae7efaf3a6410c3b79e..cdc4bb78e6911f675d59ab477ad3b35d4b221523 100755 (executable)
@@ -158,9 +158,12 @@ void PythonConsole_PyEditor::exec( const QString& command )
   _currentPrompt = READY_PROMPT;
   _buf.truncate(0);
   _isInHistory = false;
-  setText( "\n" + _currentPrompt); 
-  setText( command + "\n" ); 
-  handleReturn();
+  setText( "\n" + _currentPrompt);
+  // PAL15963 (Problem with option -u (--execute) of runSalome).
+  // Let events creating a study end before script execution starts
+  setText( command /*+ "\n"*/ ); 
+  //handleReturn();
+  qApp->postEvent( this, new QKeyEvent(QEvent::KeyPress,Key_Return,13,Qt::NoButton ));
 }
 
 void PythonConsole_PyEditor::execAndWait( const QString& command )