froglogic / Blog / Squish tip of the week: How to test custom Qt widgets

Squish tip of the week: How to test custom Qt widgets

The Squish for Qt GUI Tester comes with special support for automation of all Qt widgets, QML objects and also non-UI Qt classes. This means

  • Squish implements special support for interacting with all kinds of Qt and QML GUI controls (mouse, touch, keyboard, etc. interactions)
  • The complete Qt and QML APIs are wrapped by Squish and can be accessed using the Squish Spy and Squish test scripts allowing to implement all kinds of automated verifications- also accessing non-visual Qt classes such as data models.

For Qt’s C++ classes the wrapping is done by Squish parsing all C++ header files and generating generic Squish bindings which are exposed to the Squish test script interpreters. When your application uses custom controls, which are derived from a standard Qt widgets, Squish will support them based on the base class the custom control is derived from.

But in order to allow Squish to access the APIs which your custom Qt classes add, all you need to do is to expose the properties using the Q_PROPERTY macro or changing the public methods you want to expose to public slots.

With that, all properties and slots from your custom controls will become automatically accessible in the Squish Spy and available for test scripts and any of the script languages Squish supports.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap