Overview¶
There are two cursor types you can set in Qt, one is per application, and the other is for the current window.
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")
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")
Checking widget specific mouse cursor¶
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")
(object_name
must be a valid Squish object name.)
Waiting for a desired shape¶
def main():
...
waitFor("waitForObject('object_name').cursor.shape() != Qt.WaitCursor")
(object_name
must be a valid Squish object name.)