def placeCursor(self, pos):
        """
        Try to place the cursor in ``line`` at ``col`` if possible.
        If this is not possible, then place it at the end.
        """
        if pos > len(self.qteWidget.toPlainText()):
            pos = len(self.qteWidget.toPlainText())

        tc = self.qteWidget.textCursor()
        tc.setPosition(pos)
        self.qteWidget.setTextCursor(tc)
def placeCursor ( self , pos ) : if pos > len ( self . qteWidget . toPlainText ( ) ) : pos = len ( self . qteWidget . toPlainText ( ) ) tc = self . qteWidget . textCursor ( ) tc . setPosition ( pos ) self . qteWidget . setTextCursor ( tc )
Try to place the cursor in ``line`` at ``col`` if possible.
        If this is not possible, then place it at the end.