forked from qt-creator/qt-creator
Squish: Added helper functions for views and models
Change-Id: Ic5dc4a5fe11ec5f693ef9f5ddf3abbefd689fd99 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -25,9 +25,8 @@ def modifyRunSettingsForHookInto(projectName, port):
|
||||
envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}")
|
||||
model = envVarsTableView.model()
|
||||
changingVars = []
|
||||
for row in range(model.rowCount()):
|
||||
for index in dumpIndices(model):
|
||||
# get var name
|
||||
index = model.index(row, 0)
|
||||
envVarsTableView.scrollTo(index)
|
||||
varName = str(model.data(index).toString())
|
||||
# if its a special SQUISH var simply unset it, SQUISH_LIBQTDIR and PATH will be replaced with Qt paths
|
||||
@@ -172,9 +171,7 @@ def getQMakeFromQtVersion(qtVersion):
|
||||
mouseClick(qtVersionTab, 5, 5, 0, Qt.LeftButton)
|
||||
qtVersionsTree = waitForObject("{name='qtdirList' type='QTreeWidget' visible='1'}")
|
||||
rootIndex = qtVersionsTree.invisibleRootItem()
|
||||
rows = rootIndex.childCount()
|
||||
for currentRow in range(rows):
|
||||
current = rootIndex.child(currentRow)
|
||||
for current in dumpChildren(rootIndex):
|
||||
child = getTreeWidgetChildByText(current, qtVersion)
|
||||
if child != None:
|
||||
break
|
||||
@@ -191,9 +188,7 @@ def getQMakeFromQtVersion(qtVersion):
|
||||
return qmake
|
||||
|
||||
def getTreeWidgetChildByText(parent, text, column=0):
|
||||
childCount = parent.childCount()
|
||||
for row in range(childCount):
|
||||
child = parent.child(row)
|
||||
for child in dumpChildren(parent):
|
||||
if child.text(column)==text:
|
||||
return child
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user