cmannett85’s recommendation is a good one. Read the docs about a dozen times.
Then, if performance and memory issues are your primary concern and you think you can out-perform the QTableWidget implementation, then a QTableView interface on top of a QAbstractTableModel or QStandardItemModel is what you’re looking for.
Since you’re new to Qt’s model-view architecture, I’d recommend using the QStandardItemModel until you feel like you’re getting the hang of it. If your performance still isn’t good enough, avoid a lot of the memory duplication and wasted objects by implementing your custom model. Plus, get yourself a good textbook and read its chapter on the model-view framework about 12 times. That section alone was worth its weight in gold, imho.
Here are the basics for Qt’s custom model-view framework:
- Your actual data is stored in a list/tree somewhere
- The model provides a standard framework for queries to and edits for your data
- Proxy models allow you to sort/filter your data without affecting the original model
- The view provides a means to visually observe and interact with your data
- Delegates (often optional) tweak the appearance of your data and provide custom editors to the data
If you’re feeling both cheap and brave, check out this excerpt on implementing your own custom model. Work at it one function at a time and play with it as you go.