简体   繁体   中英

How to refresh data in PyQt TableWidget?

For example, I have a SQLite database and I grab data from this database and put it into QTableWidget . But then, I make some stuff with this data.

So, how can I update data in this table without setItem method?

Use a QTableView instead, where you can dynamically change the data in the underlying model (eg a QStandardItemModel ). In your case, you might even be able to simply use a QSqlQueryModel or QSqlTableModel with your database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM