Solved QTableWidget not displaying the QTableWidgetItem data
-
I am trying to display a QString in a QTableWidget using a QTableWidgetItem. My problem is that the string never gets displayed. I know that the code is getting executed (I have a button, which, when clicked, adds a new row containing new data to the table) but it just isn't showing up. Am I missing something or is Qt having problems?
Files of interest in my program:
https://gitlab.com/LorenDB/klock/-/blob/master/chronometer.cpp#L75 (where the signal containing the new data is emitted)
https://gitlab.com/LorenDB/klock/-/blob/master/klockmainwindow.cpp#L76 (where the new row is created)System info:
OS: Kubuntu 20.04
Qt version: 5.12.8TIA.
-
QTableWidget row/column is zero-based.
-
QTableWidget row/column is zero-based.
-
I added one to my row and column values. Still nothing.
-
That moment when it hits you...
Of course! Subtract one, not add one! Using the correct mathematics makes it work!
-
@LorenDB Then please mark this topic as solved, thx.
-
@Christian-Ehrlicher Already did that. 😉