QTableView - samples
How to use QTableView
in Nokia Qt SDK (for mobiles). I referred some of documents but still I am not clearing about the QTableView
. Please any 开发者_如何学JAVAone suggest how to use the QTableView
.
I want to show the QTableView
with three columns.
For the table data, you need to implement a model which will hold the data. If you don't require anything special, you can just subclass QAbstractTableModel.
Quoting the most important parts from the documentation:
When subclassing QAbstractTableModel, you must implement rowCount(), columnCount(), and data().
Editable models need to implement setData(), and implement flags() to return a value containing Qt::ItemIsEditable.
You haven't specified where you get the data you are going to show in your table. That determines how you need to implement the required functions.
For even more simple model, use QStandardItemModel which already has a basic implementation for all required functions.
精彩评论