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.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.