50 enum ObjectConversionBehavior {
56 QJSValue(SpecialValue value = UndefinedValue);
58 QJSValue(
const QJSValue &other);
60 inline QJSValue(QJSValue && other) : d(other.d) { other.d = 0; }
61 inline QJSValue &operator=(QJSValue &&other)
62 { std::swap(d, other.d);
return *
this; }
67 QJSValue(
double value);
68 QJSValue(
const QString &value);
69 QJSValue(
const QLatin1String &value);
70#ifndef QT_NO_CAST_FROM_ASCII
71 QT_ASCII_CAST_WARN QJSValue(
const char *str);
74 QJSValue &operator=(
const QJSValue &other);
76 explicit QJSValue(QJSPrimitiveValue &&value);
77 explicit QJSValue(QJSManagedValue &&value);
80 bool isNumber()
const;
82 bool isString()
const;
83 bool isUndefined()
const;
84#if QT_DEPRECATED_SINCE(6
, 9
)
85 QT_DEPRECATED_VERSION_X_6_9(
"This might return unexpected results; consult documentation for more information")
86 bool isVariant()
const;
88 bool isQObject()
const;
89 bool isQMetaObject()
const;
90 bool isObject()
const;
92 bool isRegExp()
const;
97 QString toString()
const;
98 double toNumber()
const;
100 quint32 toUInt()
const;
103 QVariant toVariant()
const;
104 QVariant toVariant(ObjectConversionBehavior behavior)
const;
105 QJSPrimitiveValue toPrimitive()
const;
107 QObject *toQObject()
const;
108 const QMetaObject *toQMetaObject()
const;
109 QDateTime toDateTime()
const;
111 bool equals(
const QJSValue &other)
const;
112 bool strictlyEquals(
const QJSValue &other)
const;
114 QJSValue prototype()
const;
115 void setPrototype(
const QJSValue &prototype);
117 QJSValue property(
const QString &name)
const;
118 void setProperty(
const QString &name,
const QJSValue &value);
120 bool hasProperty(
const QString &name)
const;
121 bool hasOwnProperty(
const QString &name)
const;
123 QJSValue property(quint32 arrayIndex)
const;
124 void setProperty(quint32 arrayIndex,
const QJSValue &value);
126 bool deleteProperty(
const QString &name);
128 bool isCallable()
const;
129 QJSValue call(
const QJSValueList &args = QJSValueList())
const;
130 QJSValue callWithInstance(
const QJSValue &instance,
const QJSValueList &args = QJSValueList())
const;
131 QJSValue callAsConstructor(
const QJSValueList &args = QJSValueList())
const;
133 ErrorType errorType()
const;
136 friend class QJSValuePrivate;
138 QJSValue(
void *) =
delete;