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
qquick3dxrabstracthapticeffect.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
6
#
include
"qquick3dxrabstracthapticeffect_p.h"
7
8
QT_BEGIN_NAMESPACE
9
10
/*!
11
\qmltype XrHapticEffect
12
\qmlabstract
13
\inherits QtObject
14
\inqmlmodule QtQuick3D.Xr
15
\brief Represents a haptic effect.
16
\since 6.9
17
18
XrHapticEffect defines the characteristics of the haptic effect.
19
20
This type is abstract. Use a subtype, such as \l XrSimpleHapticEffect.
21
22
\sa XrHapticFeedback XrSimpleHapticEffect
23
*/
24
25
/*!
26
\qmltype XrSimpleHapticEffect
27
\inherits XrHapticEffect
28
\inqmlmodule QtQuick3D.Xr
29
\brief Allows setting controller haptics using amplitude, duration and frequency.
30
\since 6.9
31
32
\qml
33
XrSimpleHapticEffect {
34
amplitude: 0.5
35
duration: 300
36
frequency: 3000
37
}
38
\endqml
39
40
\sa XrHapticFeedback
41
*/
42
43
/*!
44
\qmlproperty bool XrSimpleHapticEffect::amplitude()
45
\brief Defines the amplitude of the effect's vibration.
46
Acceptable values are from 0.0 to 1.0
47
\default 0.5
48
*/
49
float
QQuick3DXrSimpleHapticEffect
::amplitude()
50
{
51
return
m_amplitude;
52
}
53
54
void
QQuick3DXrSimpleHapticEffect
::
setAmplitude
(
float
newAmplitude)
55
{
56
if
(m_amplitude == newAmplitude)
57
return
;
58
m_amplitude = newAmplitude;
59
emit amplitudeChanged();
60
}
61
62
/*!
63
\qmlproperty bool XrSimpleHapticEffect::duration()
64
\brief Defines the duration of the haptic effect in milliseconds.
65
\default 30
66
*/
67
float
QQuick3DXrSimpleHapticEffect
::
duration
()
68
{
69
return
m_duration;
70
}
71
72
void
QQuick3DXrSimpleHapticEffect
::
setDuration
(
float
newDuration)
73
{
74
if
(m_duration == newDuration)
75
return
;
76
m_duration = newDuration;
77
emit durationChanged();
78
}
79
80
/*!
81
\qmlproperty bool XrSimpleHapticEffect::frequency()
82
\brief Defines the frequency of the haptic effect in Hz
83
\default 3000
84
*/
85
86
float
QQuick3DXrSimpleHapticEffect
::
frequency
()
87
{
88
return
m_frequency;
89
}
90
91
void
QQuick3DXrSimpleHapticEffect
::
setFrequency
(
float
newFrequency)
92
{
93
if
(m_frequency == newFrequency)
94
return
;
95
m_frequency = newFrequency;
96
emit frequencyChanged();
97
}
98
99
QT_END_NAMESPACE
QQuick3DXrSimpleHapticEffect
Definition
qquick3dxrabstracthapticeffect_p.h:35
QQuick3DXrSimpleHapticEffect::setAmplitude
void setAmplitude(float newAmplitude)
Definition
qquick3dxrabstracthapticeffect.cpp:54
QQuick3DXrSimpleHapticEffect::duration
float duration()
QQuick3DXrSimpleHapticEffect::setFrequency
void setFrequency(float newFrequency)
Definition
qquick3dxrabstracthapticeffect.cpp:91
QQuick3DXrSimpleHapticEffect::setDuration
void setDuration(float newDuration)
Definition
qquick3dxrabstracthapticeffect.cpp:72
QQuick3DXrSimpleHapticEffect::frequency
float frequency()
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtquick3d
src
xr
quick3dxr
qquick3dxrabstracthapticeffect.cpp
Generated on
for Qt by
1.16.1