1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DRENDERSTATSMESHESMODEL_H
5#define QQUICK3DRENDERSTATSMESHESMODEL_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
22QT_BEGIN_NAMESPACE
23
24class QQuick3DRenderStatsMeshesModel : public QAbstractTableModel
25{
26 Q_OBJECT
27 Q_PROPERTY(QString meshData READ meshData WRITE setMeshData NOTIFY meshDataChanged)
28 QML_NAMED_ELEMENT(RenderStatsMeshesModel)
29
30public:
31 QHash<int, QByteArray> roleNames() const override;
32 int rowCount(const QModelIndex &parent) const override;
33 int columnCount(const QModelIndex &parent) const override;
34 QVariant data(const QModelIndex &index, int role) const override;
35 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
36
37 const QString &meshData() const;
38
39public Q_SLOTS:
40 void setMeshData(const QString &newMeshData);
41
42Q_SIGNALS:
43 void meshDataChanged();
44
45private:
46 struct Data {
47 QString name;
48 quint64 submeshes;
49 quint64 vertices;
50 quint64 vertexBufferSize;
51 quint64 indexBufferSize;
52 };
53 QVector<Data> m_data;
54 QString m_meshData;
55};
56
57QT_END_NAMESPACE
58
59#endif // QQUICK3DRENDERSTATSMESHESMODEL_H
60

source code of qtquick3d/src/helpers/impl/qquick3drenderstatsmeshesmodel_p.h