forked from qt-creator/qt-creator
Added new qml test and continue refactoring
Refactoring of all helper functions to make it easier to recognize them as such. All helper functions in global shared scripts now follow the scheme __NAME__ Helper functions normally should not get called from outside. Change-Id: I0d02028d3f9de1ad251af9226c0460655bd9c9bd Reviewed-on: http://codereview.qt-project.org/5331 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bill King <bill.king@nokia.com>
This commit is contained in:
committed by
Bill King
parent
ddacec3eb5
commit
11f7dbda77
@@ -72,29 +72,24 @@ def replaceLineEditorContent(lineEditor, newcontent):
|
||||
|
||||
signalObjects = {}
|
||||
|
||||
def callbackFunction(object, *args):
|
||||
def __callbackFunction__(object, *args):
|
||||
global signalObjects
|
||||
# test.log("callbackFunction: "+objectMap.realName(object))
|
||||
# test.log("__callbackFunction__: "+objectMap.realName(object))
|
||||
signalObjects[objectMap.realName(object)] += 1
|
||||
|
||||
def waitForSignal(object, signal, timeout=30000):
|
||||
global signalObjects
|
||||
realName = prepareForSignal(object, signal)
|
||||
beforeCount = signalObjects[realName]
|
||||
waitFor("signalObjects[realName] > beforeCount", timeout)
|
||||
|
||||
def prepareForSignal(object, signal):
|
||||
global signalObjects
|
||||
overrideInstallLazySignalHandler()
|
||||
realName = objectMap.realName(object)
|
||||
# test.log("waitForSignal: "+realName)
|
||||
if not (realName in signalObjects):
|
||||
signalObjects[realName] = 0
|
||||
beforeCount = signalObjects[realName]
|
||||
installLazySignalHandler(object, signal, "callbackFunction")
|
||||
waitFor("signalObjects[realName] > beforeCount", timeout)
|
||||
|
||||
def markText(editor, startPosition, endPosition):
|
||||
cursor = editor.textCursor()
|
||||
cursor.setPosition(startPosition)
|
||||
cursor.movePosition(QTextCursor.StartOfLine)
|
||||
editor.setTextCursor(cursor)
|
||||
cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor, endPosition-startPosition)
|
||||
cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)
|
||||
cursor.setPosition(endPosition, QTextCursor.KeepAnchor)
|
||||
editor.setTextCursor(cursor)
|
||||
installLazySignalHandler(object, signal, "__callbackFunction__")
|
||||
return realName
|
||||
|
||||
|
||||
Reference in New Issue
Block a user