From: mkr Date: Tue, 11 Jul 2006 11:40:53 +0000 (+0000) Subject: Fix for PAL12896 : EDF220 TUI Copy from an editor and Past in the TUI does not run. X-Git-Tag: T3_2_1_pre~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f34f68199cde69ccf7be394e506068eb7075ef7a;p=modules%2Fgui.git Fix for PAL12896 : EDF220 TUI Copy from an editor and Past in the TUI does not run. --- diff --git a/src/PythonConsole/PythonConsole_PyEditor.cxx b/src/PythonConsole/PythonConsole_PyEditor.cxx index ed75e1f5b..04d136463 100755 --- a/src/PythonConsole/PythonConsole_PyEditor.cxx +++ b/src/PythonConsole/PythonConsole_PyEditor.cxx @@ -215,13 +215,15 @@ void PythonConsole_PyEditor::contentsMouseReleaseEvent( QMouseEvent* event ) int endLine = paragraphs() -1; col = charAt( event->pos(), &par ); if ( col >= 0 && par >= 0 ) { - if ( par != endLine || col < PROMPT_SIZE ) - setCursorPosition( endLine, paragraphLength( endLine ) ); + // PAL12896 --> + if ( par != endLine || col < PROMPT_SIZE ) { + QPoint aPos = paragraphRect(endLine).bottomRight(); + QMouseEvent* e = new QMouseEvent(event->type(),aPos,event->button(),event->state()); + QTextEdit::contentsMouseReleaseEvent(e); + } else - setCursorPosition( par, col ); - QApplication::clipboard()->setSelectionMode(TRUE); - paste(); - QApplication::clipboard()->setSelectionMode(FALSE); + QTextEdit::contentsMouseReleaseEvent(event); + // PAL12896 <-- } } }