def hideMe(self):
    print(('hide:', self.geometry()))
self.hide()
QTimer.singleShot(300, self.showMe)

def showMe(self):
    print(('show1:', self.geometry()))
hack = QMargins(0, 0, 0, 1)
self.setGeometry(self.geometry() + hack)
self.show()
self.setGeometry(self.geometry() - hack)
print(('show2:', self.geometry()))
PyQt5 port: how do I hide a window and let it appear at the same position