|
1Qter豆
class StringListModel : public QAbstractListModel
{
Q_OBJECT
public: StringListModel(const QStringList &strings, QObject *parent=0)
:QAbstractListModel(parent), stringList(strings){}
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
private:
QStringList stringList;
signals:
public slots:
};
谁能解释的详细一些,还有就是类中还能定义类吗?
|
|