nativeMouseClick
nativeMouseClick(objectOrName, button)
nativeMouseClick(objectOrName, x, y, button)
This function simulates a native mouse click on the objectOrName
widget at position x
and y
(if specified), otherwise at x=10 / y=10 (in the objectOrName
widget's coordinates).
The button
parameter is the mouse button that should be used, and must be one of MouseButton.LeftButton
, MouseButton.MiddleButton
, MouseButton.RightButton
, or MouseButton.NoButton
(to execute just a mouse move).
Note: The BrowserTab (or WebView) object containing the HTML element will be activated automatically for browser types that support this. Notable exception to this are all browsers automated through the 'Chromium-based Application' option.
Use nativeMouseClick for input fields instead of mouseClick to make sure that clicking them moves input focus into them. This properly replicates a user action. The nativeMouseClick
function ensures that the browser tab of the object has input focus and that it appears in front of other windows. This cannot be accomplished through the mouseClick
function, which runs as part of the web site and cannot change the operating system input focus. It can only move the focus within the web site.
© 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.