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
QQuick3DXrSpatialAnchor Class Reference

#include <qquick3dxrspatialanchor_p.h>

+ Inheritance diagram for QQuick3DXrSpatialAnchor:
+ Collaboration diagram for QQuick3DXrSpatialAnchor:

Public Types

enum class  Classification {
  Unknown , Wall , Ceiling , Floor ,
  Table , Seat , Window , Door ,
  Other
}
 

Signals

void offset3DChanged ()
 
void extent3DChanged ()
 
void positionChanged ()
 
void rotationChanged ()
 
void classificationChanged ()
 
void classificationStringChanged ()
 
void has2DBoundsChanged ()
 
void has3DBoundsChanged ()
 
void offset2DChanged ()
 
void extent2DChanged ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 

Public Member Functions

 QQuick3DXrSpatialAnchor (QtQuick3DXr::XrSpaceId space, QUuid &uuid, QObject *parent=nullptr)
 \qmltype XrSpatialAnchor \inherits QtObject \inqmlmodule QtQuick3D.Xr
 
 ~QQuick3DXrSpatialAnchor () override
 
QVector3D offset3D () const
 \qmlproperty vector3d XrSpatialAnchor::offset3D
 
void setOffset3D (const QVector3D &newOffset)
 
QVector3D extent3D () const
 \qmlproperty vector3d XrSpatialAnchor::extent3D
 
void setExtent3D (const QVector3D &newExtent)
 
QVector3D position () const
 \qmlproperty vector3d XrSpatialAnchor::position
 
void setPosition (const QVector3D &newPosition)
 
QQuaternion rotation () const
 \qmlproperty quaternion XrSpatialAnchor::rotation
 
void setRotation (const QQuaternion &newRotation)
 
Classification classification () const
 \qmlproperty enumeration XrSpatialAnchor::classification
 
void setClassification (Classification newClassification)
 
QString classificationString () const
 \qmlproperty string XrSpatialAnchor::classificationString
 
void setClassificationString (const QString &newClassificationString)
 
bool has2DBounds () const
 \qmlproperty bool XrSpatialAnchor::has2DBounds
 
void setBounds2D (const QVector2D &offset, const QVector2D &extent)
 
bool has3DBounds () const
 \qmlproperty bool XrSpatialAnchor::has3DBounds
 
void setBounds3D (const QVector3D &offset, const QVector3D &extent)
 
QVector2D offset2D () const
 \qmlproperty vector2d XrSpatialAnchor::offset2D
 
QVector2D extent2D () const
 \qmlproperty vector2d XrSpatialAnchor::extent2D
 
QString identifier () const
 \qmlproperty string XrSpatialAnchor::identifier
 
QSet< QUuidroomLayoutUuids () const
 
void setRoomLayoutUuids (const QSet< QUuid > &newRoomLayoutUuids)
 
QSet< QUuidspaceContainerUuids () const
 
void setSpaceContainerUuids (const QSet< QUuid > &newSpaceContainerUuids)
 
QtQuick3DXr::XrSpaceId space () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 

Properties

bool has2DBounds
 
bool has3DBounds
 
QVector2D offset2D
 
QVector2D extent2D
 
QVector3D offset3D
 
QVector3D extent3D
 
QVector3D position
 
QQuaternion rotation
 
Classification classification
 
QString classificationString
 
QString identifier
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Friends

class QQuick3DXrAnchorManager
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

Definition at line 32 of file qquick3dxrspatialanchor_p.h.

Member Enumeration Documentation

◆ Classification

Enumerator
Unknown 
Wall 
Ceiling 
Floor 
Table 
Seat 
Window 
Door 
Other 

Definition at line 51 of file qquick3dxrspatialanchor_p.h.

Constructor & Destructor Documentation

◆ QQuick3DXrSpatialAnchor()

QT_BEGIN_NAMESPACE QQuick3DXrSpatialAnchor::QQuick3DXrSpatialAnchor ( QtQuick3DXr::XrSpaceId space,
QUuid & uuid,
QObject * parent = nullptr )

\qmltype XrSpatialAnchor \inherits QtObject \inqmlmodule QtQuick3D.Xr

Tracks a specific location or object in real space.

This type represents a spatial anchor that tracks a specific location or object in real space. It provides information about the anchor's position, rotation, classification, and bounds.

Spatial anchors are accessed through an \l XrSpatialAnchorListModel.

Note
Anchor objects are provided by the system. They cannot be created in QML.

See the \l{Qt Quick 3D - XR Spatial Anchors Example} for how to use this type.

\qmlproperty enumeration XrSpatialAnchor::Classification

The classification of the spatial anchor. \readonly

The Classification enum provides a set of predefined category types that describe the purpose or context of a spatial anchor.

\value Classification.Unknown The label has not been set or identified. \value Classification.Wall The anchor represents a wall. \value Classification.Ceiling The anchor represents a ceiling. \value Classification.Floor The anchor represents a floor. \value Classification.Table The anchor represents a table. \value Classification.Seat The anchor represents a seat. \value Classification.Window The anchor represents a window. \value Classification.Door The anchor represents a door. \value Classification.Other The anchor was not identified as any of the above types. See: \l classificationString

The following table shows the mapping between the classification type in \qxr, OpenXR, and VisionOS. If the classification type from the system falls outside of the defined types, then the Type is set to Other, and the system type is provided by the \l classificationString property.

Note
The classification string can also be {Other}.

\table \header

  • Type
  • OpenXR
  • VisionOS
  • Description \row
  • Unknown
  • -
  • -
  • The label has not been set or identified. \row
  • Wall
  • WALL_FACE
  • Wall
  • The anchor represents a wall. \row
  • Ceiling
  • CEILING
  • Ceiling
  • The anchor represents a ceiling. \row
  • Floor
  • FLOOR
  • Floor
  • The anchor represents a floor. \row
  • Table
  • TABLE
  • Table
  • The anchor represents a table. \row
  • Seat
  • COUCH
  • Seat
  • The anchor represents a seat. \row
  • Window
  • WINDOW_FRAME
  • Window
  • The anchor represents a window. \row
  • Door
  • DOOR_FRAME
  • Door
  • The anchor represents a door. \row
  • Other
  • -
  • -
  • The anchor represents something else. See: \l classificationString \endtable

Definition at line 110 of file qquick3dxrspatialanchor.cpp.

◆ ~QQuick3DXrSpatialAnchor()

QQuick3DXrSpatialAnchor::~QQuick3DXrSpatialAnchor ( )
override

Definition at line 117 of file qquick3dxrspatialanchor.cpp.

Member Function Documentation

◆ classification()

QQuick3DXrSpatialAnchor::Classification QQuick3DXrSpatialAnchor::classification ( ) const

\qmlproperty enumeration XrSpatialAnchor::classification

The classification type of the spatial anchor. \readonly

This property returns the \l {XrSpatialAnchor::Classification}{classification type} for this anchor (for example,Table or Floor) describing the anchor's purpose or context.

Note
The classification type coming from the system might not be in the set of labels defined by the \l Classification enum, in which case the type will be set to Other and the \l classificationString property will contain the original label.
See also
classificationString

Definition at line 226 of file qquick3dxrspatialanchor.cpp.

◆ classificationChanged

void QQuick3DXrSpatialAnchor::classificationChanged ( )
signal

◆ classificationString()

QString QQuick3DXrSpatialAnchor::classificationString ( ) const

\qmlproperty string XrSpatialAnchor::classificationString

The classification type of the spatial anchor as a string. \readonly

This property returns the classification type as a string if one exists. If the classification type is not in the set of types defined by the \l Classification enums, the label is set to Other, and this property can be used to access the type as it was reported by the system.

Note
This string can be empty or change, depending on the system and how the anchor gets classified.
See also
classification

Definition at line 254 of file qquick3dxrspatialanchor.cpp.

◆ classificationStringChanged

void QQuick3DXrSpatialAnchor::classificationStringChanged ( )
signal

◆ extent2D()

QVector2D QQuick3DXrSpatialAnchor::extent2D ( ) const

\qmlproperty vector2d XrSpatialAnchor::extent2D

The 2D extent of the spatial anchor. \readonly

This property holds the spatial anchor's size in two dimensions (width and height) within the X/Z plane. It is valid when \l has2DBounds is true.

See also
has2DBounds, offset2D

Definition at line 359 of file qquick3dxrspatialanchor.cpp.

◆ extent2DChanged

void QQuick3DXrSpatialAnchor::extent2DChanged ( )
signal

◆ extent3D()

QVector3D QQuick3DXrSpatialAnchor::extent3D ( ) const

\qmlproperty vector3d XrSpatialAnchor::extent3D

The 3D extent of the spatial anchor. \readonly

This property specifies the spatial anchor's volume in three dimensions (width, height, and depth). It is valid when \l has3DBounds is true.

See also
offset3D, has3DBounds

Definition at line 155 of file qquick3dxrspatialanchor.cpp.

◆ extent3DChanged

void QQuick3DXrSpatialAnchor::extent3DChanged ( )
signal

◆ has2DBounds()

bool QQuick3DXrSpatialAnchor::has2DBounds ( ) const

\qmlproperty bool XrSpatialAnchor::has2DBounds

Indicates whether the spatial anchor has 2D bounds. \readonly

This property holds true if the spatial anchor has 2D bounds, described by \l offset2D and \l extent2D, indicating that it represents a flat surface (for example, a floor or wall).

Otherwise, it returns false.

See also
offset2D, extent2D, has3DBounds

Definition at line 280 of file qquick3dxrspatialanchor.cpp.

◆ has2DBoundsChanged

void QQuick3DXrSpatialAnchor::has2DBoundsChanged ( )
signal

◆ has3DBounds()

bool QQuick3DXrSpatialAnchor::has3DBounds ( ) const

\qmlproperty bool XrSpatialAnchor::has3DBounds

Indicates whether the spatial anchor has 3D bounds. \readonly

This property returns true if the spatial anchor has 3D bounds, indicating that it represents a volume (for example, a table or a cupboard). The bounds are described by \l offset3D and \l extent3D.

Otherwise, it returns false.

See also
offset3D, extent3D, has2DBounds

Definition at line 313 of file qquick3dxrspatialanchor.cpp.

◆ has3DBoundsChanged

void QQuick3DXrSpatialAnchor::has3DBoundsChanged ( )
signal

◆ identifier()

QString QQuick3DXrSpatialAnchor::identifier ( ) const

\qmlproperty string XrSpatialAnchor::identifier

A unique identifier for this spatial anchor. \readonly

This property holds a unique identifier associated with the spatial anchor. This is the same identifier referenced by a \l XrSpatialAnchorListModel.

Definition at line 373 of file qquick3dxrspatialanchor.cpp.

◆ offset2D()

QVector2D QQuick3DXrSpatialAnchor::offset2D ( ) const

\qmlproperty vector2d XrSpatialAnchor::offset2D

The 2D offset of the spatial anchor.

\readonly This property holds the offset of the anchor's bounds within the X/Z plane. It is valid when \l has2DBounds is true.

See also
has2DBounds, extent2D

Definition at line 343 of file qquick3dxrspatialanchor.cpp.

◆ offset2DChanged

void QQuick3DXrSpatialAnchor::offset2DChanged ( )
signal

◆ offset3D()

QVector3D QQuick3DXrSpatialAnchor::offset3D ( ) const

\qmlproperty vector3d XrSpatialAnchor::offset3D

The 3D offset of the spatial anchor. \readonly

This property provides the 3D offset of the anchor's bounds (in meters) from the anchor's \l position.

See also
offset3D, has3DBounds

Definition at line 131 of file qquick3dxrspatialanchor.cpp.

◆ offset3DChanged

void QQuick3DXrSpatialAnchor::offset3DChanged ( )
signal

◆ position()

QVector3D QQuick3DXrSpatialAnchor::position ( ) const

\qmlproperty vector3d XrSpatialAnchor::position

The position of the spatial anchor.

\readonly This property returns the 3D position (in meters) of the spatial anchor's origin within the session's coordinate system.

Definition at line 177 of file qquick3dxrspatialanchor.cpp.

◆ positionChanged

void QQuick3DXrSpatialAnchor::positionChanged ( )
signal

◆ roomLayoutUuids()

QSet< QUuid > QQuick3DXrSpatialAnchor::roomLayoutUuids ( ) const

Definition at line 378 of file qquick3dxrspatialanchor.cpp.

◆ rotation()

QQuaternion QQuick3DXrSpatialAnchor::rotation ( ) const

\qmlproperty quaternion XrSpatialAnchor::rotation

The orientation of the spatial anchor. \readonly

This property provides the spatial anchor's rotation (as a quaternion).

Definition at line 198 of file qquick3dxrspatialanchor.cpp.

◆ rotationChanged

void QQuick3DXrSpatialAnchor::rotationChanged ( )
signal

◆ setBounds2D()

void QQuick3DXrSpatialAnchor::setBounds2D ( const QVector2D & offset,
const QVector2D & extent )

Definition at line 285 of file qquick3dxrspatialanchor.cpp.

◆ setBounds3D()

void QQuick3DXrSpatialAnchor::setBounds3D ( const QVector3D & offset,
const QVector3D & extent )

Definition at line 318 of file qquick3dxrspatialanchor.cpp.

◆ setClassification()

void QQuick3DXrSpatialAnchor::setClassification ( Classification newClassification)

Definition at line 231 of file qquick3dxrspatialanchor.cpp.

◆ setClassificationString()

void QQuick3DXrSpatialAnchor::setClassificationString ( const QString & newClassificationString)

Definition at line 259 of file qquick3dxrspatialanchor.cpp.

◆ setExtent3D()

void QQuick3DXrSpatialAnchor::setExtent3D ( const QVector3D & newExtent)

Definition at line 160 of file qquick3dxrspatialanchor.cpp.

◆ setOffset3D()

void QQuick3DXrSpatialAnchor::setOffset3D ( const QVector3D & newOffset)

Definition at line 136 of file qquick3dxrspatialanchor.cpp.

◆ setPosition()

void QQuick3DXrSpatialAnchor::setPosition ( const QVector3D & newPosition)

Definition at line 182 of file qquick3dxrspatialanchor.cpp.

◆ setRoomLayoutUuids()

void QQuick3DXrSpatialAnchor::setRoomLayoutUuids ( const QSet< QUuid > & newRoomLayoutUuids)

Definition at line 383 of file qquick3dxrspatialanchor.cpp.

◆ setRotation()

void QQuick3DXrSpatialAnchor::setRotation ( const QQuaternion & newRotation)

Definition at line 203 of file qquick3dxrspatialanchor.cpp.

◆ setSpaceContainerUuids()

void QQuick3DXrSpatialAnchor::setSpaceContainerUuids ( const QSet< QUuid > & newSpaceContainerUuids)

Definition at line 393 of file qquick3dxrspatialanchor.cpp.

◆ space()

QtQuick3DXr::XrSpaceId QQuick3DXrSpatialAnchor::space ( ) const
inline

Definition at line 101 of file qquick3dxrspatialanchor_p.h.

◆ spaceContainerUuids()

QSet< QUuid > QQuick3DXrSpatialAnchor::spaceContainerUuids ( ) const

Definition at line 388 of file qquick3dxrspatialanchor.cpp.

Friends And Related Symbol Documentation

◆ QQuick3DXrAnchorManager

friend class QQuick3DXrAnchorManager
friend

Definition at line 119 of file qquick3dxrspatialanchor_p.h.

Property Documentation

◆ classification

Classification QQuick3DXrSpatialAnchor::classification
read

Definition at line 43 of file qquick3dxrspatialanchor_p.h.

◆ classificationString

QString QQuick3DXrSpatialAnchor::classificationString
read

Definition at line 44 of file qquick3dxrspatialanchor_p.h.

◆ extent2D

QVector2D QQuick3DXrSpatialAnchor::extent2D
read

Definition at line 38 of file qquick3dxrspatialanchor_p.h.

◆ extent3D

QVector3D QQuick3DXrSpatialAnchor::extent3D
read

Definition at line 40 of file qquick3dxrspatialanchor_p.h.

◆ has2DBounds

bool QQuick3DXrSpatialAnchor::has2DBounds
read

Definition at line 35 of file qquick3dxrspatialanchor_p.h.

◆ has3DBounds

bool QQuick3DXrSpatialAnchor::has3DBounds
read

Definition at line 36 of file qquick3dxrspatialanchor_p.h.

◆ identifier

QString QQuick3DXrSpatialAnchor::identifier
read

Definition at line 45 of file qquick3dxrspatialanchor_p.h.

◆ offset2D

QVector2D QQuick3DXrSpatialAnchor::offset2D
read

Definition at line 37 of file qquick3dxrspatialanchor_p.h.

◆ offset3D

QVector3D QQuick3DXrSpatialAnchor::offset3D
read

Definition at line 39 of file qquick3dxrspatialanchor_p.h.

◆ position

QVector3D QQuick3DXrSpatialAnchor::position
read

Definition at line 41 of file qquick3dxrspatialanchor_p.h.

◆ rotation

QQuaternion QQuick3DXrSpatialAnchor::rotation
read

Definition at line 42 of file qquick3dxrspatialanchor_p.h.


The documentation for this class was generated from the following files: