from qtpy.QtGui import QCursor cursor = QCursor() cursor.setShape(Qt.CrossCursor) # set the cursor icon to crosshair
from qtpy.QtGui import QCursor cursor = QCursor() cursor.setPos(-1000,-1000) # move the cursor offscreen to hide it cursor.setPos(500,500) # move the cursor back onscreen to show itIn this example, we create a new QCursor object and use its setPos() method to move the cursor offscreen (hiding it) and back onscreen (showing it). Package Library: PyQt5 or PySide2, both of which are Python bindings for Qt.