0

I have a python project that do the following import

from PyQt4 import QtGui, QtCore

I would like to change the cursor's shape at certain point, for example, I would create a new QCursor object

self.cursor_oh = QCursor()
self.cursor_oh.setShape()

most documentation and searches I did indicate to just set the shape using enum type such as:

Qt.OpenHandCursor

But, such enum is not recognized and it always results in the following error message:

AttributeError: 'module' object has no attribute 'OpenHandCursor'

So, what am I missing here?

For Comment
  • 1,139
  • 4
  • 13
  • 25

2 Answers2

0

Apparently, the Qt namespace is under QtCore, so by adding the QtCore qualifier, it found all of the Qt cursor types.

For Comment
  • 1,139
  • 4
  • 13
  • 25
0

I haven't tried this in PyQt4 but in PyQt6 it has to be:

QtCore.Qt.CursorShape.OpenHandCursor
asynts
  • 2,213
  • 2
  • 21
  • 35