if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
t = QtGui.QTableView()
m = Model(t)
t.setModel(m)
t.show()
sys.exit(app.exec_())
How to change background color after editing QTableView cell?