Why do my widgets always get names like MyWidget34 rather than more descriptive names?

Squish tries to create the most descriptive names for GUI objects. By default is uses the QObject name. If this property isn't unique (or is empty), other possibly unique properties are examined (window caption, button text, etc.) before falling back to <ObjectType><num>.

One solution (and probably the best!) to get better names in generated scripts is to give all the widgets descriptive, short and unique QObject names in the AUT's source code.

If the custom widgets have other possibly unique properties, like a label, etc., Squish can be told to try using these properties. For example, suppose that we have a custom widget called CanvasView which has a unique label property. To tell Squish about this, create a file called, for example, myinit.tcl that contains the following line:

setUniqueProperty CanvasView label

Then tell Squish to interpret this file at startup:

squishrunner --config addInitScript Qt <absolute_path>/myinit.tcl

After doing this, Squish will attempt to use the CanvasView's label property for identification if its value is unique. See also, Configuring squishrunner.