Why doesn't Squish record mouse move events?

Squish only records mouse move events when a mouse button is pressed—even if Qt's mouse tracking is enabled. This is because in most cases mouse move events that take place when no mouse button is pressed can be ignored since they don't need to be replayed for the widgets to function properly. Furthermore, recording these events would produce a lot of script code which would not affect the application, but would make the script harder to read and maintain.

For those rare cases where it is necessary to record all the mouse move events because they are essential for the widget to work correctly, you can change Squish's behavior. For example, let's assume that we have a custom widget of type CanvasView for which we want to record all mouse move events. We can tell Squish to switch on mouse tracking for widgets of this type by creating and registering a suitable init file. For example, we could create a file called myinit.tcl that contained this line:

setMouseTracking CanvasView true

Then we can tell Squish to execute this file at startup:

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

After this, when recording a test case, mouse move events on CanvasView widgets will be recorded even if no mouse button is pressed. See also, Configuring squishrunner.