1
#############################################################################
3
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4
## Contact: http://www.qt-project.org/legal
6
## This file is part of Qt Creator.
8
## Commercial License Usage
9
## Licensees holding valid commercial Qt licenses may use this file in
10
## accordance with the commercial license agreement provided with the
11
## Software or, alternatively, in accordance with the terms contained in
12
## a written agreement between you and Digia. For licensing terms and
13
## conditions see http://qt.digia.com/licensing. For further information
14
## use the contact form at http://qt.digia.com/contact-us.
16
## GNU Lesser General Public License Usage
17
## Alternatively, this file may be used under the terms of the GNU Lesser
18
## General Public License version 2.1 as published by the Free Software
19
## Foundation and appearing in the file LICENSE.LGPL included in the
20
## packaging of this file. Please review the following information to
21
## ensure the GNU Lesser General Public License version 2.1 requirements
22
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
## In addition, as a special exception, Digia gives you certain additional
25
## rights. These rights are described in the Digia Qt LGPL Exception
26
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
#############################################################################
30
source("../../shared/qtcreator.py")
33
sourceExampleQt4 = os.path.join(sdkPath, "Examples", "4.7", "declarative", "text",
34
"textselection", "qml", "textselection.qml")
35
sourceExampleQt5 = os.path.join(qt5SDKPath(), "examples", "quick", "text", "textselection",
37
if not neededFilePresent(sourceExampleQt4):
39
if not neededFilePresent(sourceExampleQt5):
41
startApplication("qtcreator" + SettingsPath)
42
if not startedWithoutPluginError():
44
targetsAndQuickVersion = {Targets.DESKTOP_480_GCC:[1, sourceExampleQt4],
45
Targets.DESKTOP_501_DEFAULT:[2, sourceExampleQt5]}
46
for targ, qVerAndEx in targetsAndQuickVersion.items():
47
# using a temporary directory won't mess up a potentially existing
48
workingDir = tempDir()
49
checkedTargets, projectName = createNewQtQuickApplication(workingDir, None,
52
test.log("Building project Qt Quick %d Application (%s)"
53
% (qVerAndEx[0], Targets.getStringForTarget(targ)))
54
result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
55
invokeMenuItem("Build","Build All")
56
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
57
if not checkCompile():
58
test.fatal("Compile failed")
61
test.log("Running project (includes build)")
63
result = addExecutableAsAttachableAUT(projectName, 11223)
64
allowAppThroughWinFW(workingDir, projectName)
66
result = runAndCloseApp(True, projectName, 11223, subprocessFunction, SubprocessType.QT_QUICK_APPLICATION)
68
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION)
69
removeExecutableAsAttachableAUT(projectName, 11223)
70
deleteAppFromWinFW(workingDir, projectName)
72
result = runAndCloseApp()
74
logApplicationOutput()
75
invokeMenuItem("File", "Close All Projects and Editors")
76
invokeMenuItem("File", "Exit")
78
def subprocessFunction():
79
textEdit = waitForObject("{container={type='QmlApplicationViewer' unnamed='1' visible='1'} "
80
"enabled='true' type='TextEdit' unnamed='1' visible='true'}")
81
test.log("Test dragging")
82
dragItemBy(textEdit, 30, 30, 50, 50, 0, Qt.LeftButton)
83
test.log("Test editing")
84
textEdit.cursorPosition = 0
85
typeLines(textEdit, "This text is entered by Squish...")
86
test.log("Closing QmlApplicationViewer")
87
sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}")