[PyQt] WaitCursor is ignored

Mads Ipsen mpi at comxnet.dk
Tue Nov 3 09:43:43 GMT 2009


Hey,

I want to display a widget as disabled (setEnabled(False)) with its 
cursor set to Qt.WaitCursor.

Disabling the widget, however, always display the widget with a normal 
Qt.ArrowCursor if if the cursor is changed. How do I obtain a disabled 
widget with a Qt.WaitCursor? Code that reproduces the problem is shown 
below.

Best regards,

Mads

import sys

from PyQt4 import QtCore, QtGui

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)

    widget = QtGui.QWidget()
    widget.show()
    widget.setEnabled(False)

    cursor = QtGui.QCursor(QtCore.Qt.WaitCursor)
    widget.setCursor(cursor)

    sys.exit(app.exec_())


-- 
+-------------------------------------------------------------+
| Mads Ipsen, Scientific developer                            |
+-------------------------------+-----------------------------+
| QuantumWise A/S               | phone:         +45-29716388 |
| Nørre Søgade 27A              | www:    www.quantumwise.com |
| DK-1370 Copenhagen K, Denmark | email:  mpi at quantumwise.com |
+-------------------------------+-----------------------------+




More information about the PyQt mailing list