When you did the hardcoded example you did not correctly code the column titles and instead you just put them as items, you can see that "1" "2" and "3" are still the titles. With your code you should have put; table_widget.setHorizontalHeaderLabels(["Name", "Email", "Phone"])
@anandbabu82403 жыл бұрын
Hi, I'm new to this pyqt5 and I'm trying to create a simple application using qtablewidget, I don't know what method to use to sum a single column. For example, I have created 10 rows and 6 columns. The user enter the values in each columns. After completing all the rows, I want the result of 6th column to be displayed in any widget (say qlineedit). My questions are, 1. How to get the values entered by the user 2. How to sum the 6th column values of all 10 rows. 3. Do I need to write the calculations in a method or is there any inbuilt event/slot available. Please guide me, I have been searching since 2 weeks but I didn't get a single idea.