2012-05-10 10:53:06 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
source("../../shared/suites_qtta.py")
|
|
|
|
|
|
|
|
|
|
def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
|
|
|
|
|
startApplication("qtcreator" + SettingsPath)
|
2013-02-22 14:31:39 +01:00
|
|
|
if not startedWithoutPluginError():
|
|
|
|
|
return None
|
2012-05-10 10:53:06 +02:00
|
|
|
# create qt quick application
|
|
|
|
|
createNewQtQuickApplication(projectDir, projectName)
|
|
|
|
|
# open qml file
|
2013-01-30 18:15:38 +01:00
|
|
|
qmlFile = projectName + ".QML.qml/" + projectName + ".main\\.qml"
|
|
|
|
|
if not openDocument(qmlFile):
|
|
|
|
|
test.fatal("Could not open %s" % qmlFile)
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return None
|
2012-05-10 10:53:06 +02:00
|
|
|
# get editor
|
|
|
|
|
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
|
|
|
|
# place to line if needed
|
|
|
|
|
if line:
|
|
|
|
|
# place cursor to component
|
|
|
|
|
if not placeCursorToLine(editorArea, line):
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
return None
|
|
|
|
|
return editorArea
|
|
|
|
|
|
|
|
|
|
def verifyCurrentLine(editorArea, currentLineExpectedText, verifyMessage):
|
|
|
|
|
currentLineText = str(lineUnderCursor(editorArea)).strip();
|
|
|
|
|
return test.compare(currentLineText, currentLineExpectedText, verifyMessage)
|
|
|
|
|
|