Why does my Mac toolbar look different in Squish? (Qt)

Last edited on

Mac toolbars and dialogs may look different for AUTs executed by Squish

Symptoms

For Qt applications running on a Mac, it sometimes occurs that their toolbar appears in one place when run normally, and in a different place when run by Squish. A similar problem can occur with file dialogs.

Explanation

When Qt applications run on a Mac they use the native toolbar support and so show their toolbars just like any other Mac application. However, when Squish executes a Qt application, Squish forces the application to use Qt’s own toolbar code, and to use Qt dialogs rather than native dialogs. This is done for the following reasons:

Although the program looks different when using Qt rather than native Mac toolbars or dialogs, this does not affect testing. After all, we don’t normally want to waste time and resources testing standard GUI components like toolbars or native dialogs since these are provided by the operating system (or by Qt); instead we expect such fundamentals to work correctly. What is more important is testing our own applications, i.e., testing what happens when a toolbar button is pressed no matter what the button looks like or where it is.

The same applies for Qt dialogs versus native dialogs on other platforms too.