Does it have to call QTableWidget::setItem for every cell?
Not quite clear about the usage about QTableWidget. (not in view/model mode)
After setColumnCount and setColumnCount, run the program, what confuse me is:
- The table widget works (click to edit, saved to UI after editing), but QTableWidget::item returns null for a existing cell, so the properties of the cell can't be modified
- Does it have to call QTableWidget::setItem for every cell?
That only sets how many to expect. You must insert as many items as you specify.
Remember that we're not talking about abstract things. Items take memory. If you have an empty 10000x10000 table that just holds the width and the height - it costs almost nothing, but fill it up with items and you've got yourself a real memory hog.
Only insert the items you actually need.