49 enum ObjectConversionBehavior {
55 QJSValue(SpecialValue value = UndefinedValue);
57 QJSValue(
const QJSValue &other);
59 inline QJSValue(QJSValue && other) : d(other.d) { other.d = 0; }
60 inline QJSValue &operator=(QJSValue &&other)
61 { std::swap(d, other.d);
return *
this; }
66 QJSValue(
double value);
67 QJSValue(
const QString &value);
68 QJSValue(
const QLatin1String &value);
69#ifndef QT_NO_CAST_FROM_ASCII
70 QT_ASCII_CAST_WARN QJSValue(
const char *str);
73 QJSValue &operator=(
const QJSValue &other);
75 explicit QJSValue(QJSPrimitiveValue &&value);
76 explicit QJSValue(QJSManagedValue &&value);
79 bool isNumber()
const;
81 bool isString()
const;
82 bool isUndefined()
const;
83#if QT_DEPRECATED_SINCE(6
, 9
)
84 QT_DEPRECATED_VERSION_X_6_9(
"This might return unexpected results; consult documentation for more information")
85 bool isVariant()
const;
87 bool isQObject()
const;
88 bool isQMetaObject()
const;
89 bool isObject()
const;
91 bool isRegExp()
const;
96 QString toString()
const;
97 double toNumber()
const;
99 quint32 toUInt()
const;
102 QVariant toVariant()
const;
103 QVariant toVariant(ObjectConversionBehavior behavior)
const;
104 QJSPrimitiveValue toPrimitive()
const;
106 QObject *toQObject()
const;
107 const QMetaObject *toQMetaObject()
const;
108 QDateTime toDateTime()
const;
110 bool equals(
const QJSValue &other)
const;
111 bool strictlyEquals(
const QJSValue &other)
const;
113 QJSValue prototype()
const;
114 void setPrototype(
const QJSValue &prototype);
116 QJSValue property(
const QString &name)
const;
117 void setProperty(
const QString &name,
const QJSValue &value);
119 bool hasProperty(
const QString &name)
const;
120 bool hasOwnProperty(
const QString &name)
const;
122 QJSValue property(quint32 arrayIndex)
const;
123 void setProperty(quint32 arrayIndex,
const QJSValue &value);
125 bool deleteProperty(
const QString &name);
127 bool isCallable()
const;
128 QJSValue call(
const QJSValueList &args = QJSValueList())
const;
129 QJSValue callWithInstance(
const QJSValue &instance,
const QJSValueList &args = QJSValueList())
const;
130 QJSValue callAsConstructor(
const QJSValueList &args = QJSValueList())
const;
132 ErrorType errorType()
const;
135 friend class QJSValuePrivate;
137 QJSValue(
void *) =
delete;