From 7b2f965eb70ddcb508db687f22145dd0ab412427 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 21 May 2007 10:16:18 +0000 Subject: [PATCH] NPAL15963 (Problem with option -u (--execute) of runSalome). 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PythonConsole/PythonConsole_PyEditor.cxx b/src/PythonConsole/PythonConsole_PyEditor.cxx index c48c534fd..cdc4bb78e 100755 --- a/src/PythonConsole/PythonConsole_PyEditor.cxx +++ b/src/PythonConsole/PythonConsole_PyEditor.cxx @@ -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 ) -- 2.39.2