self.ui.gridLayout.removeWidget(self.ui.dragDataEdit)
self.ui.dragDataEdit.close()
self.ui.dragDataEdit = myDumpBox(self.ui.centralwidget)
self.ui.gridLayout.addWidget(self.ui.dragDataEdit, 0, 0, 1, 1)
How to replace a Widget with another using Qt?