forked from qt-creator/qt-creator
Squish: Replaced function moveTextCursor
Change-Id: Ie4cccd0de668690a3d66baf422bcfff7acae7345 Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
This commit is contained in:
committed by
Robert Löhning
parent
53fb9d4ae8
commit
ea63b86e49
@@ -30,21 +30,6 @@ def placeCursorToLine(editor, line, isRegex=False):
|
||||
editor.setTextCursor(cursor)
|
||||
return True
|
||||
|
||||
# this function moves the text cursor of an editor by using Qt internal functions
|
||||
# this is more reliable (especially on Mac) than the type() approach
|
||||
# param editor an editor object
|
||||
# param moveOperation a value of enum MoveOperation (of QTextCursor)
|
||||
# param moveAnchor a value of enum MoveMode (of QTextCursor)
|
||||
# param n how often repeat the move operation?
|
||||
def moveTextCursor(editor, moveOperation, moveAnchor, n=1):
|
||||
if not editor or isinstance(editor, (str,unicode)):
|
||||
test.fatal("Either got a NoneType or a string instead of an editor object")
|
||||
return False
|
||||
textCursor = editor.textCursor()
|
||||
result = textCursor.movePosition(moveOperation, moveAnchor, n)
|
||||
editor.setTextCursor(textCursor)
|
||||
return result
|
||||
|
||||
# this function returns True if a QMenu is
|
||||
# popped up above the given editor
|
||||
# param editor is the editor where the menu should appear
|
||||
|
Reference in New Issue
Block a user