Unsolved Button display problem
-
Hello,
I'm building an application with PyQt5 on Windows and I have a problem with button display. When I click on a button, I disabled it with the method :
setEnabled(False)
The desired result is :
However, sometimes, the display does not work and the button remains blue, as if the animation was interrupted :
Do you know what the problem is and how I can fix it?
-
Could be a timing problem since the disabling is happening during the press.
try to not call setEnabled directly from the slot that is called on click, but with delayQTimer::singleShot(0, this, SLOT(disableButton());
where disableButton() is a slot that calls setEnabled(false) on the button.
-
I chose a time of 300ms and it's working well.
Thanks for your help.