Squish: Avoid Squish crash on Mac

Squish 5.0.1 has problems handling special locations of menus on Mac
using Qt5.2.

Change-Id: I9acc6d0f63e00815ff9ab532cb56a8ca5bb69d6a
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
Christian Stenger
2013-12-10 16:59:46 +01:00
parent cae7802902
commit b748c1b3d2

View File

@@ -228,6 +228,14 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000) waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except: except:
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton) nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
# HACK to avoid squish crash using Qt5.2 on Squish 5.0.1 - remove asap
if platform.system() == "Darwin" and not isQt4Build:
if menu == "Tools" and item == "Options...":
nativeType("<Command+,>")
return
if menu == "File" and item == "Exit":
nativeType("<Command+q>")
return
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu) menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
waitFor("menuObject.visible", 1000) waitFor("menuObject.visible", 1000)
activateItem(menuObject) activateItem(menuObject)