How to call a function when clicked close(X) button present at the top-right side of the window in pyqt4. The below code displays a window which has a table and the link has an image and description of output of the code.
from PyQt4 import QtCore, QtGui
import sys
app = QtGui.QApplication(sys.argv)
table = QtGui.QTableWidget()
table.setGeometry(QtCore.QRect(220, 100, 881, 100))
table.setColumnCount(4)
table.setRowCount(1)
table.setHorizontalHeaderLabels(QtCore.QString("Id;name;address;country").split(";"))
table.setColumnWidth(0, 120)
table.setColumnWidth(1, 450)
table.setColumnWidth(2, 140)
table.setColumnWidth(3, 140)
table.show()
app.exec_()