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
qquick3dxrinputmanager.cpp
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
7
8#if defined(Q_OS_VISIONOS)
9# include "visionos/qquick3dxrinputmanager_visionos_p.h"
10#else
11# include "openxr/qopenxrinputmanager_p.h"
12#endif
13
15
17
19{
20 static QQuick3DXrInputManager instance;
21 return &instance;
22}
23
25{
26 Q_D(const QQuick3DXrInputManager);
27 return d->leftHandInput();
28}
29
31{
32 Q_D(const QQuick3DXrInputManager);
33 return d->rightHandInput();
34}
35
36void QQuick3DXrInputManager::registerController(QQuick3DXrController *controller)
37{
38 Q_D(QQuick3DXrInputManager);
39
40 connect(controller, &QObject::destroyed, this, [this](QObject *obj) { unregisterController(static_cast<QQuick3DXrController *>(obj)); });
41
42 d->registerController(controller);
43}
44
45void QQuick3DXrInputManager::unregisterController(QQuick3DXrController *controller)
46{
47 Q_D(QQuick3DXrInputManager);
48 d->unregisterController(controller);
49}
50
52{
53 Q_D(const QQuick3DXrInputManager);
54 return d->isValid();
55}
56
57QQuick3DXrInputManager::QQuick3DXrInputManager(QObject *parent)
58 : QObject(parent)
59 , d_ptr(new QQuick3DXrInputManagerPrivate(*this))
60{
61
62}
63
68
69QT_END_NAMESPACE
void registerController(QQuick3DXrController *controller)
void unregisterController(QQuick3DXrController *controller)
QQuick3DXrHandInput * leftHandInput() const
QQuick3DXrHandInput * rightHandInput() const
static QQuick3DXrInputManager * instance()
Combined button and popup list for selecting options.