qt6windows7/examples/widgets/tutorials/modelview/3_changingmodel/mymodel.h
2023-10-29 23:33:08 +01:00

28 lines
648 B
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef MYMODEL_H
#define MYMODEL_H
#include <QAbstractTableModel>
#include <QTimer>
class MyModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit MyModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
private slots:
void timerHit();
private:
QTimer *timer;
};
#endif // MYMODEL_H