Okay, so the problem is that when you show the QMessageBox, the QMessageBox becomes the active window... so when the user releases the mouse button the mouseReleaseEvent goes to the QMessageBox rather than to your ubtn.
I think the easiest way around the problem would be to for ubtn to call "emit clicked()" from the mouseReleaseEvent() method rather than mousePressEvent(); that way the button can revert to its regular color before the QMessageBox is shown, and therefore active-window-change takes place.