Article - Accessing Qt methods, members, properties, signals, slots and enums (Qt)

Skip to end of metadata
Go to start of metadata
The following information is primarily meant for developers of Qt applications, to help with extending the level of automated testing of Qt applications.

Table of Contents

Standard Qt classes

Squish test scripts can access methods and members of standard Qt classes.

Custom Qt classes

For custom Qt classes, their methods are accessible in test scripts if they have been declared as Qt slots or marked with Q_INVOKABLE. In addition properties that have been declared as QObject properties via Q_PROPERTY are available for both verifications and search by name.

Using properties for object name generation

Properties declared via Q_PROPERTY can be configured and used by the Squish name generator.

Dynamic properties set via QObject.setProperty() can be queried via QObject.property() but are unfortunately not available as properties and automatic name generation.

(Also see Object Name Generation.)

Custom enums

In addition, the Q_ENUMS macro can be used to declare custom enum types to the (Qt) "moc" tool, which should make them accessible from Squish.

Limitations

Please note that template based return types are not supported and the respective property or slot will not be listed in the Properties or Methods views in the Squish IDE.

A possible workaround can be to return an object based on a non template based class.

Related Information

Labels:
q_property q_property Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.