]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for PAL12896 : EDF220 TUI Copy from an editor and Past in the TUI does not run.
authormkr <mkr@opencascade.com>
Tue, 11 Jul 2006 11:40:53 +0000 (11:40 +0000)
committermkr <mkr@opencascade.com>
Tue, 11 Jul 2006 11:40:53 +0000 (11:40 +0000)
src/PythonConsole/PythonConsole_PyEditor.cxx

index ed75e1f5b4e2ed5cc423d76ad6c915d41727ebbb..04d13646360592688ec6ca42424b1dd9b9387e1f 100755 (executable)
@@ -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 <--
       }
     }
   }