booleanmodel.h

来自「QT4 gui programming的随书光盘」· C头文件 代码 · 共 33 行

H
33
字号
#ifndef BOOLEANMODEL_H#define BOOLEANMODEL_H#include <QAbstractItemModel>class Node;class BooleanModel : public QAbstractItemModel{public:    BooleanModel(QObject *parent = 0);    ~BooleanModel();    void setRootNode(Node *node);    QModelIndex index(int row, int column,                      const QModelIndex &parent) const;    QModelIndex parent(const QModelIndex &child) const;    int rowCount(const QModelIndex &parent) const;    int columnCount(const QModelIndex &parent) const;    QVariant data(const QModelIndex &index, int role) const;    QVariant headerData(int section, Qt::Orientation orientation,                        int role) const;private:    Node *nodeFromIndex(const QModelIndex &index) const;    Node *rootNode;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?