2016-01-15 14:55:33 +01:00
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
2022-08-19 15:59:36 +02:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2012-05-10 10:53:06 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
|
|
|
|
|
def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
|
2018-08-22 14:37:34 +02:00
|
|
|
startQC()
|
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
|
2022-03-18 11:52:14 +01:00
|
|
|
qmlFile = "%s.%s.qml\.qrc./.main\\.qml" % (projectName, projectName)
|
2013-01-30 18:15:38 +01:00
|
|
|
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)
|
|
|
|
|
|