Qt Convenience API
Note: The Qt Convenience API is only available in Squish for Qt editions.
Qt Convenience Functions
Activates an item from a list or menu. | |
Activates a link in a QTextBrowser or QLabel. | |
Downcast a QObject* to its most specific type. | |
Clicks the specified button. | |
Click an item inside a list, table, or tree. | |
Clicks on a Tab in a QTabWidget. | |
Double-clicks the mouse. | |
Double-click an item in a View widget. | |
Double-taps on an object. | |
Performs a Drag and Drop operation | |
Performs a drag operation. | |
Performs a drop of an operation started by startDrag | |
Performs a gesture on a QML Flickable. | |
Plays a gesture on a window or widget | |
Hides the on-screen keyboard when it is showing. | |
Installs a Qt Event Handler. | |
Handles signals by objects that are looked up by name (lazily) whenever a signal is emitted. | |
Installs a Qt Signal Handler. | |
Long Press with a mouse or tap-gesture. | |
Performs a mouse drag operation with a fixed delay after the initial press. | |
Clicks the mouse on the specified object. | |
Performs a mouse drag operation. | |
Performs a mouse wheel operation. | |
Simulates the user opening a context menu. | |
Simulates opening a context menu in an Item of a View. | |
Performs a press and hold operation on a QDeclarativeItem. | |
Returns the QQmlContext for a given object. | |
Returns the QQmlEngine associated with an object. | |
Opens a gesture file and returns a GestureBuilder object. | |
Scrolls a widget to a position. | |
Sends a Qt Event to an object. | |
Changes the keyboard input focus to a specified object. | |
Enables the recording of mouseMove events for QWidget classes. | |
Enable or disable recording of mouse drag operations on QWidgets. | |
For top-level windows: Maximize, Minimize, FullScreen, or Normal. | |
Clicks "down" on a QSpinBox. | |
Clicks "up" on a QSpinBox. | |
Initiates a drag operation on a given object. | |
Tap on a Widget or an Item. | |
Performs a touch-based drag operation. | |
Performs a touch-based press operation. | |
Performs a touch-based release operation. | |
Types text into an editable input widget/item. | |
Uninstalls a Qt Event Handler. | |
Uninstalls a "lazy" Qt signal handler. | |
Uninstalls a Qt Signal Handler. | |
Waits for a Qt signal to be emitted by a QObject. |
Qt Helper Classes/APIs
Class for representing touch gestures. | |
API for customizing how Squish handles QML types. | |
Helper methods added to QWebView and QWebEngineView classes. |
Qt Convenience Function Parameters
Some of Qt's convenience functions can take a modifierState
argument which indicates which special keys are pressed at the time of a mouse click. And some of the functions can also take a button
argument which indicates which mouse button was clicked.
The modifierState
can be one or more of the following: Qt.NoModifier
, Qt.AltModifier
, Qt.ControlModifier
, Qt.KeypadModifier
, Qt.MetaModifier
, Qt.ShiftModifier
. If more than one is used they must be OR
-d together, for example, Qt.AltModifier|Qt.ShiftModifier
. The form shown here works for Python and JavaScript. For Perl and Ruby replace the period with two colons, e.g., Qt::ControlModifier
, and for Tcl use the enum
function, e.g., enum Qt ControlModifier
.
The button
can be any one of: Qt.NoButton
, Qt.LeftButton
, Qt.MidButton
, Qt.RightButton
.
- For Perl use the following syntax:
Qt::LeftButton
. - For Ruby use the following syntax:
Qt::LEFT_BUTTON
. - For Tcl use the following syntax:
enum Qt LeftButton
.
Native Dialogs on KDE
To ensure the most reliable recording and replaying of tests, Squish uses Qt's own dialogs (e.g., for choosing colors, files, and fonts), rather than the underlying platform's native dialogs.
Unfortunately, on KDE, Qt uses the KDE dialogs and this can cause problems when developing cross-platform test scripts. The solution is to set the QT_PLATFORM_PLUGIN
environment variable to an invalid value, such as QT_PLATFORM_PLUGIN=nonesuch
. This can be done, for instance, in the squishide
's Test Suite Settings view's Environment section.
© 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.