Python Forum
QTableWidget - Retrieve content from a cell
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTableWidget - Retrieve content from a cell
#1
Hi, guys...

I have a qtablewidget with 3 columns that shows registers from my database.
Each row has a checkbox in the 3rd column.
Im trying to retrieve the content in the first cell that has the checkbox checked.
Here is the code :
items = []
for i in range(self.tblparc.rowCount()):
  item = self.tblparc.item(i,2)
  if item.checkState() == QtCore.Qt.Checked:
    items.append(self.tblparc.itemAt(i,0))
Is it right ? How can I retrieve the contents ?
Thanks
Reply


Messages In This Thread
QTableWidget - Retrieve content from a cell - by Ninja2112 - Apr-04-2025, 06:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PyQt5 QTableWidget duplicates rows number Ninja2112 6 986 Apr-03-2025, 01:26 AM
Last Post: Ninja2112
  [PyQt] QTableWidget print problem JokerSob 8 7,290 Jan-28-2022, 06:08 PM
Last Post: Axel_Erfurt
  [PyQt] How do I display the DB table I will choose from the QComboBox in QTableWidget JokerSob 2 3,279 Aug-05-2021, 03:00 PM
Last Post: JokerSob
  Displaying database info in QTableWidget thewolf 6 9,066 Apr-03-2021, 02:49 PM
Last Post: thewolf
  [PyQt] Help: check content of combobox in horizontal header of QTableWidget mart79 1 4,714 Jul-26-2020, 06:18 PM
Last Post: deanhystad
  [PyQt] Add validation (regex) to QTableWidget cells mart79 0 3,671 May-05-2020, 12:51 PM
Last Post: mart79
  [PyQt] QTableWidget stylesheet error mart79 3 9,254 Feb-26-2020, 04:54 PM
Last Post: Denni
  [PyQt] Pyqt5: How do you make a button that adds new row with data to a Qtablewidget YoshikageKira 6 9,780 Jan-02-2020, 04:32 PM
Last Post: Denni
  [PyQt] QTableWidget cell validation littleGreenDude 1 9,483 Jan-18-2019, 07:44 PM
Last Post: littleGreenDude
  Printing QTableWidget to an DIN A4 page Mady 2 8,612 Dec-18-2018, 06:56 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020