You might try the simpler syntax for connect: self.referenceButton.clicked.connect(self.abc) Since I don't use your form of connect, I don't understand it, but aren't you connecting twice? Is it only the close button that it not working? Please reduce your posted code to a few lines, few people like to read so much to get to the crucial lines.