'How i can hide the PushButton when Cursor hovering it. PyQt6

I've already tried this:

 def mouseReleaseEvent(self):
        if self.pushButton_2.underMouse(self):
            self.pushButton_2.hide()

but, it's do nothing. Maybe i made something incorrect or how do hiding button on hovering in another way?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source