|
|
| DATreeModel (QObject *par=nullptr, int colCount=1) |
| |
|
| DATreeModel (DATree *t, QObject *par=nullptr, int colCount=1) |
| |
|
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
| |
|
QModelIndex | parent (const QModelIndex &index) const override |
| |
|
int | rowCount (const QModelIndex &p) const override |
| |
|
int | columnCount (const QModelIndex &parent) const override |
| |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| | 表头
|
| |
|
Qt::ItemFlags | flags (const QModelIndex &index) const override |
| |
|
QVariant | data (const QModelIndex &index, int role) const override |
| |
|
void | update () |
| | 强制刷新
|
| |
| virtual QVariant | dataTreeItem (DATreeItem *i, const QModelIndex &index, int role) const |
| | 针对DATreeItem的data重载
|
| |
| void | setColumnCount (int col) |
| | 设置列的数量
|
| |
| void | setHeaderLabel (int column, const QString &s) |
| | 设置表头
|
| |
| void | setTree (DATree *t) |
| | 设置树
|
| |
| DATree * | getTree () |
| | 获取树的指针
|
| |
| const DATree * | getTree () const |
| | 获取树的指针
|
| |
|
DATreeItem * | indexToItem (const QModelIndex &index) const |
| |
|
QModelIndex | itemToIndex (const DATreeItem *i) const |
| |