Squish: Fix accessing Options on OSX

Accessing the application menu inside the menubar of OSX
does not work properly since using Qt5.
For some time using default keysequences worked fine, but
for the Preferences (Options menu) this stopped working,
so make the used hack even more crude.

Change-Id: I48ed37dc69b8c64f649f0130d48d4deb02afb87e
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2016-05-13 10:06:30 +02:00
parent 3eb81f3708
commit 07ba87349d

View File

@@ -176,10 +176,17 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except:
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
# HACK as Squish fails to provide a proper way to access the system menu
if platform.system() == "Darwin":
if menu == "Tools" and item == "Options...":
nativeType("<Command+,>")
#nativeType("<Command+,>")
# the following is a pure HACK because using the default key sequence seems to be broken
# when running from inside Squish
menuBar = waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 500)
nativeMouseClick(menuBar, 75, 5, 0, Qt.LeftButton)
for _ in range(3):
nativeType("<Down>")
nativeType("<Return>")
return
if menu == "File" and item == "Exit":
nativeType("<Command+q>")