Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dxrspatialanchorlistmodel_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DXRSPATIALANCHORLISTMODEL_P_H
5#define QQUICK3DXRSPATIALANCHORLISTMODEL_P_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 <QAbstractListModel>
19#include <QtQmlIntegration/qqmlintegration.h>
20#include <QtCore/qpointer.h>
21#include <QtCore/qstringlist.h>
22#include <QUuid>
23
24QT_BEGIN_NAMESPACE
25
26class QQuick3DXrAnchorManager;
28
30{
31 Q_OBJECT
32 Q_PROPERTY(FilterMode filterMode READ filterMode WRITE setFilterMode NOTIFY filterModeChanged FINAL)
36
39public:
45 Q_ENUM(FilterMode)
46
48 Wall = 0x1,
49 Ceiling = 0x2,
50 Floor = 0x4,
51 Table = 0x8,
52 Seat = 0x10,
53 Window = 0x20,
54 Door = 0x40,
55 Other = 0x80,
56 };
57 Q_ENUM(ClassificationFlag)
60
64
65 explicit QQuick3DXrSpatialAnchorListModel(QObject *parent = nullptr);
66
67 int rowCount(const QModelIndex &parent) const override;
68 QVariant data(const QModelIndex &index, int role) const override;
69 QHash<int, QByteArray> roleNames() const override;
70
73
74 FilterMode filterMode() const;
75 void setFilterMode(FilterMode newFilterMode);
76
78 void setIdentifierFilter(const QStringList &filter);
79
81 void setClassificationFilter(ClassificationFlags newClassFilter);
82
84 void setClassificationStringFilter(const QStringList &newClassStringFilter);
85
91
92private Q_SLOTS:
94 void handleAnchorRemoved(QUuid uuid);
95 void handleAnchorUpdated(QQuick3DXrSpatialAnchor* anchor);
96
97private:
98 bool matchesAnchorFilter(QQuick3DXrSpatialAnchor *anchor) const;
99 QList<QQuick3DXrSpatialAnchor *> anchorsFiltered() const;
100
101 QPointer<QQuick3DXrAnchorManager> m_anchorManager;
102 FilterMode m_filterMode = FilterMode::All;
103 QSet<QString> m_uuids;
104 ClassificationFlags m_classFilter;
105 QSet<QString> m_classStringFilter;
106};
107
108QT_END_NAMESPACE
109
110#endif // QQUICK3DXRSPATIALANCHORLISTMODEL_P_H
QStringList classificationStringFilter() const
\qmlproperty list<string> XrSpatialAnchorListModel::classificationStringFilter
int rowCount(const QModelIndex &parent) const override
Returns the number of rows under the given parent.
ClassificationFlags classificationFilter() const
\qmlproperty enumeration XrSpatialAnchorListModel::classificationFilter
Q_INVOKABLE void requestSceneCapture()
\qmlmethod void XrSpatialAnchorListModel::requestSceneCapture()
QStringList identifierFilter() const
\qmlproperty list<string> XrSpatialAnchorListModel::identifierFilter
QVariant data(const QModelIndex &index, int role) const override
Returns the data stored under the given role for the item referred to by the index.
FilterMode filterMode() const
\qmlproperty enumeration XrSpatialAnchorListModel::filterMode
void setClassificationFilter(ClassificationFlags newClassFilter)
void setIdentifierFilter(const QStringList &filter)
void setClassificationStringFilter(const QStringList &newClassStringFilter)
QHash< int, QByteArray > roleNames() const override
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE QString getClassificationString(QQuick3DXrSpatialAnchorListModel::ClassificationFlag classification)
static QQuick3DXrSpatialAnchorListModel::ClassificationFlag getClassificationFlagType(QQuick3DXrSpatialAnchor::Classification classification)