While running Qprocess I want to display a WaitCursor over a QListWidget. I use the following code.
Code:
def StartProc(self):
self.lstWidget.viewport().setCursor(QtCore.Qt.WaitCursor)
self.lstWidget.setDisabled(True)
self.runner.finished.connect(self.FinProc)
self.runner.start(some_cmd)
def FinProc(self):
self.lstWidget.setDisabled(False)
self.lstWidget.viewport().setCursor(QtCore.Qt.ArrowCursor)
With the above code I see lstWidget get disabled while 'some_cmd' is running but I never see the cursor change. When 'some_cmd' is finished I see lstWidget re-enabled.
Commenting out the last line of the FinProc function causes the cursor to get switched to a WaitCursor
after some_cmd is finished. That is completely unexpected
and weird.
Identical code works perfectly on a QTextEdit. Not sure why it doesn't work with QListWidget but I am open to suggestions.