139
139
clickButton(waitForObject(":Next_QPushButton"))
140
140
return str(projectName)
142
def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls):
143
comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' "
144
"leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' "
146
if qtQuickVersion == 1:
147
selectFromCombo(comboBox, "Qt Quick 1.1")
149
test.warning("Controls are not available for Quick 1.")
150
elif qtQuickVersion == 2:
152
selectFromCombo(comboBox, "Qt Quick Controls 1.0")
154
selectFromCombo(comboBox, "Qt Quick 2.0")
156
test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion))
157
clickButton(waitForObject(":Next_QPushButton"))
142
159
# Selects the Qt versions for a project
143
160
# param checks turns tests in the function on if set to True
144
161
# param available a list holding the available targets
175
192
# param projectName is the name for the new project
176
193
# param checks turns tests in the function on if set to True
177
194
def createProject_Qt_GUI(path, projectName, checks = True):
178
template = "Qt Gui Application"
195
template = "Qt Widgets Application"
179
196
available = __createProjectOrFileSelectType__(" Applications", template)
180
197
__createProjectSetNameAndPath__(path, projectName, checks)
181
198
checkedTargets = __selectQtVersionDesktop__(checks, available)
234
251
__verifyFileCreation__(path, expectedFiles)
235
252
return checkedTargets
237
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None,
254
def createNewQtQuickApplication(workingDir, projectName = None,
238
255
targets=Targets.desktopTargetClasses(), qtQuickVersion=1,
241
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick %d Application (from Existing QML File)"
242
% qtQuickVersion, fromWelcome)
244
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick %d Application (Built-in Types)"
245
% qtQuickVersion, fromWelcome)
256
fromWelcome=False, withControls=False):
257
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome)
246
258
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
248
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}")
249
type(baseLineEd, templateFile)
250
nextButton = waitForObject(":Next_QPushButton")
251
clickButton(nextButton)
259
__createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
252
260
checkedTargets = __chooseTargets__(targets, available)
254
nextButton = waitForObject(":Next_QPushButton")
255
clickButton(nextButton)
262
clickButton(waitForObject(":Next_QPushButton"))
256
263
__createProjectHandleLastPage__()
258
265
progressBarWait(10000)
259
266
return checkedTargets, projectName
261
def createNewQtQuickUI(workingDir, qtQuickVersion=1):
262
__createProjectOrFileSelectType__(" Applications", "Qt Quick %d UI" % qtQuickVersion)
268
def createNewQtQuickUI(workingDir, qtQuickVersion=1, withControls=False):
269
__createProjectOrFileSelectType__(" Applications", "Qt Quick UI")
263
270
if workingDir == None:
264
271
workingDir = tempDir()
265
272
projectName = __createProjectSetNameAndPath__(workingDir)
273
__createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
266
274
__createProjectHandleLastPage__()
267
275
return projectName
322
330
# parameter target can be an OR'd value of Targets
323
331
# parameter availableTargets should be the result of __createProjectOrFileSelectType__()
324
332
# or use None as a fallback
325
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
326
isMaddeDisabled=True):
333
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None):
327
334
if availableTargets != None:
328
335
available = availableTargets
333
340
if platform.system() in ('Windows', 'Microsoft'):
334
341
available.remove(Targets.EMBEDDED_LINUX)
335
342
available.append(Targets.DESKTOP_480_MSVC2010)
337
for target in filter(lambda x: x in available,
338
(Targets.MAEMO5, Targets.HARMATTAN)):
339
available.remove(target)
343
for target in filter(lambda x: x in available,
344
(Targets.MAEMO5, Targets.HARMATTAN)):
345
available.remove(target)
340
346
checkedTargets = []
341
347
for current in available:
342
348
mustCheck = targets & current == current
445
451
# assuming we're still on the build settings of the current project (TODO)
446
452
switchViewTo(ViewConstants.PROJECTS)
447
453
if sType == SubprocessType.QT_QUICK_UI:
448
selectConfig = "QML Viewer"
454
if "qmlscene" in executable:
455
selectConfig = "QML Scene"
457
selectConfig = "QML Viewer"
450
459
selectConfig = executable
451
460
selectFromCombo(waitForObject("{buddy={text='Run configuration:' type='QLabel' "