From f34f68199cde69ccf7be394e506068eb7075ef7a Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 11 Jul 2006 11:40:53 +0000 Subject: [PATCH] Fix for PAL12896 : EDF220 TUI Copy from an editor and Past in the TUI does not run. --- src/PythonConsole/PythonConsole_PyEditor.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 <-- } } } -- 2.39.2