How to delete or clean a tablewidget in Pyqt5 or Pyqt

1

Hello People, how can you erase or clean a tablewidget in Pyqt5 or Pyqt ?

self.obj_form_cliente ---> esto es el formulario 
tw_garantes_lista  ---- > esto es como se llama el control "nombre de del control tipo tablewidget"

while (self.obj_form_cliente.tw_garantes_lista.rowCount() > 0)
        self.obj_form_cliente.tw_garantes_lista.removeRow(0)

Well I hope it serves you:)

    
asked by gonzalo scatena 02.09.2016 в 22:35
source

1 answer

2

To clean the QTableWidget you can use the clear() method to clean all the widget , in other words, we would restart it completely. Using the clearContents() method we clean only the content.

    
answered by 13.01.2017 в 16:28