1 | // Copyright (C) 2022 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICK3DRENDERSTATSPASSESMODEL_H |
5 | #define QQUICK3DRENDERSTATSPASSESMODEL_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/QAbstractTableModel> |
19 | #include <QtCore/QObject> |
20 | #include <QtQml/qqml.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QQuick3DRenderStatsPassesModel : public QAbstractTableModel |
25 | { |
26 | Q_OBJECT |
27 | Q_PROPERTY(QString passData READ passData WRITE setPassData NOTIFY passDataChanged) |
28 | QML_NAMED_ELEMENT(RenderStatsPassesModel) |
29 | public: |
30 | QHash<int, QByteArray> roleNames() const override; |
31 | int rowCount(const QModelIndex &parent) const override; |
32 | int columnCount(const QModelIndex &parent) const override; |
33 | QVariant data(const QModelIndex &index, int role) const override; |
34 | QVariant (int section, Qt::Orientation orientation, int role) const override; |
35 | |
36 | const QString &passData() const; |
37 | |
38 | public Q_SLOTS: |
39 | void setPassData(const QString &newPassData); |
40 | |
41 | Q_SIGNALS: |
42 | void passDataChanged(); |
43 | |
44 | private: |
45 | struct Data { |
46 | QString name; |
47 | QString size; |
48 | quint64 vertices; |
49 | quint32 drawCalls; |
50 | }; |
51 | QVector<Data> m_data; |
52 | QString m_passData; |
53 | }; |
54 | |
55 | QT_END_NAMESPACE |
56 | |
57 | #endif // QQUICK3DRENDERSTATSPASSESMODEL_H |
58 | |