[PySide] Workaround for BadCursor errors?

Kevin Cole dc.loco at gmail.com
Sun Dec 4 17:04:53 CET 2016


I'm on Ubuntu Linux Yakkety (16.10), PySide 1.2.2. I'm trying to set
the cursor shape and then restore it to its default at a later time.
Initially, I tried self.setCursor(Qt.BlankCursor) and
self.setCursor(Qt.ArrowCursor) on the QGraphicsSvgItem.  When that
failed I went to:


Using QApplications.setOverrideCursor(QCursor(Qt.BlankCursor)) failed with:

X Error: BadCursor (invalid Cursor parameter) 6
  Major opcode: 2 (X_ChangeWindowAttributes)
  Resource id:  0xa

Switching to QApplications.setOverrideCursor(Qt.BlankCursor) -- i.e.
using just the shape -- worked.

However, the restoreOverrideCursor failed with the error above, and
exiting the program complains:

X Error: BadCursor (invalid Cursor parameter) 6
  Major opcode: 95 (X_FreeCursor)
  Resource id:  0xa

More information about the PySide mailing list