Sorry, I couldn't think of a better title.
I have a QStyledItemDelegate that sets the MousePointer to QtCore.Qt.PointingHandCursor when I hover over column 8. The problem is that when I exit column 8 above the table header, the cursor remains QtCore.Qt.PointingHandCursor, but my thought was that the cursor should be restored by QtWidgets.QApplication.restoreOverrideCursor().
My delegate:
from PyQt5 import QtWidgets
from PyQt5 import QtGui, QtCore
class reportDelegate(QtWidgets.QStyledItemDelegate):
def initStyleOption(self, option, index):
super(reportDelegate, self).initStyleOption(option, index)
if option.state & QtWidgets.QStyle.State_MouseOver:
if option.index.column() == 8 and option.index.row() >=0:
if option.text:
QtWidgets.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
else:
QtWidgets.QApplication.restoreOverrideCursor()
else:
QtWidgets.QApplication.restoreOverrideCursor()