Overview There are two cursor types you can set in Qt, one is per application, and the other is for the current window.
Potential Crashes
The example below can in some cases lead to crashes in the application, if the Qt pointer is invalidated between script statements.
This is something Squish can unfortunately not detect.Checking the application override mouse cursor Checking the current shape def main ():
...
if isNull ( QApplication . overrideCursor ()) or QApplication . overrideCursor () . shape () != Qt . WaitCursor :
test . fail ( "No or unexpected override cursor shape found" )
else :
test . passes ( "Expected override cursor shape found" )
test.py An applications may only set an override cursor some time after it got started, so an immediate check might fail.
Waiting for a desired shape def main ():
...
waitFor ( "isNull(QApplication.overrideCursor()) or QApplication.overrideCursor().shape() != Qt.WaitCursor" )
test.py Checking the current shape def main ():
...
if waitForObject ( "object_name" ) . cursor . shape () != Qt . WaitCursor ):
test . fail ( "Unexpected cursor shape found" )
else :
test . passes ( "Expected cursor shape found" )
test.py (object_name
must be a valid Squish object name.)
Waiting for a desired shape def main ():
...
waitFor ( "waitForObject('object_name').cursor.shape() != Qt.WaitCursor" )
test.py (object_name
must be a valid Squish object name.)
Copyright © 2024 The Qt Company Ltd. All rights reserved.
Privacy Policy Usage Data Processing by Google We would like to use Google Analytics to get a better understanding of how
you use the website.
By agreeing to this, your usage data will be stored in the USA and processed
by Google LLC. Both Google as well as federal US agencies can access this data
and combine it with any other data about you, such as your search history,
personal accounts or any other data known to Google.
See our privacy
policy to toggle this feature and to learn more, or contact
us .