summaryrefslogtreecommitdiff
path: root/tests/system/shared/utils.py
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2013-12-10 12:53:20 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2013-12-10 12:53:20 +0100
commit9f831dde07cb2411808534e76669b28a1b76e21d (patch)
treeed6252d64c9a3ab27aa93786272cda1b6008f3c7 /tests/system/shared/utils.py
parentcdac81f896ef4b052d76f96485a08e6ec13696b8 (diff)
parentea1a92484ac99057b06130a012164bf9788650e9 (diff)
downloadqt-creator-wip/clang.tar.gz
Merge remote-tracking branch 'origin/master' into wip/clangwip/clang
Change-Id: I8a2c8068a3f2b15034fb1bf6304c9a0f3f0e3c8f
Diffstat (limited to 'tests/system/shared/utils.py')
-rw-r--r--tests/system/shared/utils.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index 3279980aab..b46499d8b2 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -112,19 +112,16 @@ def selectFromLocator(filter, itemName = None):
doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton)
def wordUnderCursor(window):
- cursor = window.textCursor()
- oldposition = cursor.position()
- cursor.movePosition(QTextCursor.StartOfWord)
- cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor)
- returnValue = cursor.selectedText()
- cursor.setPosition(oldposition)
- return returnValue
+ return textUnderCursor(window, QTextCursor.StartOfWord, QTextCursor.EndOfWord)
def lineUnderCursor(window):
+ return textUnderCursor(window, QTextCursor.StartOfLine, QTextCursor.EndOfLine)
+
+def textUnderCursor(window, fromPos, toPos):
cursor = window.textCursor()
oldposition = cursor.position()
- cursor.movePosition(QTextCursor.StartOfLine)
- cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)
+ cursor.movePosition(fromPos)
+ cursor.movePosition(toPos, QTextCursor.KeepAnchor)
returnValue = cursor.selectedText()
cursor.setPosition(oldposition)
return returnValue