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// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DXRSPATIALANCHORLISTMODEL_P_H
7#define QQUICK3DXRSPATIALANCHORLISTMODEL_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QAbstractListModel>
21#include <QtQmlIntegration/qqmlintegration.h>
22#include <QtCore/qpointer.h>
23#include <QtCore/qstringlist.h>
24#include <QUuid>
25
26QT_BEGIN_NAMESPACE
27
28class QQuick3DXrAnchorManager;
30
32{
33 Q_OBJECT
34 Q_PROPERTY(FilterMode filterMode READ filterMode WRITE setFilterMode NOTIFY filterModeChanged FINAL)
38
41public:
47 Q_ENUM(FilterMode)
48
50 Wall = 0x1,
51 Ceiling = 0x2,
52 Floor = 0x4,
53 Table = 0x8,
54 Seat = 0x10,
55 Window = 0x20,
56 Door = 0x40,
57 Other = 0x80,
58 };
59 Q_ENUM(ClassificationFlag)
62
66
67 explicit QQuick3DXrSpatialAnchorListModel(QObject *parent = nullptr);
68
69 int rowCount(const QModelIndex &parent) const override;
70 QVariant data(const QModelIndex &index, int role) const override;
71 QHash<int, QByteArray> roleNames() const override;
72
75
76 FilterMode filterMode() const;
77 void setFilterMode(FilterMode newFilterMode);
78
80 void setIdentifierFilter(const QStringList &filter);
81
83 void setClassificationFilter(ClassificationFlags newClassFilter);
84
86 void setClassificationStringFilter(const QStringList &newClassStringFilter);
87
93
94private Q_SLOTS:
96 void handleAnchorRemoved(QUuid uuid);
97 void handleAnchorUpdated(QQuick3DXrSpatialAnchor* anchor);
98
99private:
100 bool matchesAnchorFilter(QQuick3DXrSpatialAnchor *anchor) const;
101 QList<QQuick3DXrSpatialAnchor *> anchorsFiltered() const;
102
103 QPointer<QQuick3DXrAnchorManager> m_anchorManager;
104 FilterMode m_filterMode = FilterMode::All;
105 QSet<QString> m_uuids;
106 ClassificationFlags m_classFilter;
107 QSet<QString> m_classStringFilter;
108};
109
110QT_END_NAMESPACE
111
112#endif // QQUICK3DXRSPATIALANCHORLISTMODEL_P_H
void anchorUpdated(QQuick3DXrSpatialAnchor *anchor)
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)