import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QTableWidget, QTableWidgetItem class EmployeeTable(QMainWindow): def __init__(self, employees): super().__init__() self.employees = employees self.initUI() def initUI(self): tableWidget = QTableWidget(self) tableWidget.setRowCount(len(self.employees)) tableWidget.setColumnCount(3) for i, emp in enumerate(self.employees): # Create QTableWidgetItem objects with employee data id_item = QTableWidgetItem(str(emp['id'])) name_item = QTableWidgetItem(emp['name']) salary_item = QTableWidgetItem(str(emp['salary'])) # Add the items to the table tableWidget.setItem(i, 0, id_item) tableWidget.setItem(i, 1, name_item) tableWidget.setItem(i, 2, salary_item) self.setCentralWidget(tableWidget) self.setWindowTitle('Employee Table') if __name__ == '__main__': employees = [ {'id': 1, 'name': 'John Doe', 'salary': 50000}, {'id': 2, 'name': 'Jane Smith', 'salary': 60000}, {'id': 3, 'name': 'Bob Johnson', 'salary': 55000}, ] app = QApplication(sys.argv) ex = EmployeeTable(employees) ex.show() sys.exit(app.exec_())In this example, we create a Table Widget with three columns for ID, name, and salary. We then loop through the list of employees, create QTableWidgetItem objects with their data, and add them to the table using the setItem() method. Finally, we set the table as the central widget of a QMainWindow and show it. Overall, the QTableWidgetItem class provides a convenient way to create and manage items in a Qt Table Widget using Python.