8#include <private/qqmlrefcount_p.h>
11#include <private/qv4domerrors_p.h>
12#include <private/qv4engine_p.h>
13#include <private/qv4functionobject_p.h>
14#include <private/qv4scopedvalue_p.h>
15#include <private/qv4jscall_p.h>
17#include <QtCore/qobject.h>
18#include <QtQml/qjsvalue.h>
19#include <QtQml/qjsengine.h>
20#include <QtQml/qqmlfile.h>
21#include <QtNetwork/qnetworkreply.h>
22#include <QtCore/qstringconverter.h>
23#include <QtCore/qxmlstream.h>
24#include <QtCore/qstack.h>
25#include <QtCore/qdebug.h>
26#include <QtCore/qbuffer.h>
28#include <private/qv4objectproto_p.h>
29#include <private/qv4scopedvalue_p.h>
30#include <private/qv4arraybuffer_p.h>
31#include <private/qv4jsonobject_p.h>
35#define V4THROW_REFERENCE(string) \
37 ScopedObject error(scope, scope.engine->newReferenceErrorObject(QStringLiteral(string))); \
38 return scope.engine->throwError(error); \
392 switch (
r->d()->d->type) {
403 name =
r->d()->d->name;
435 return Encode(
r->d()->d->type);
455 if (
r->d()->d->parent)
478 if (
r->d()->d->children.isEmpty())
491 if (
r->d()->d->children.isEmpty())
504 if (!
r->d()->d->parent)
507 for (
int ii = 0; ii <
r->d()->
d->parent->children.size(); ++ii) {
508 if (
r->d()->d->parent->children.at(ii) ==
r->d()->d) {
526 if (!
r->d()->d->parent)
529 for (
int ii = 0; ii <
r->d()->
d->parent->children.size(); ++ii) {
530 if (
r->d()->d->parent->children.at(ii) ==
r->d()->d) {
531 if ((ii + 1) ==
r->d()->d->parent->children.size())
558 if (
d->nodePrototype.isUndefined()) {
560 d->nodePrototype.set(v4,
p);
563 return d->nodePrototype.value();
573 switch (
data->type) {
603 if (
d->elementPrototype.isUndefined()) {
612 return d->elementPrototype.value();
618 if (
d->attrPrototype.isUndefined()) {
623 p->defineAccessorProperty(
QStringLiteral(
"name"), method_name,
nullptr);
624 p->defineAccessorProperty(
QStringLiteral(
"value"), method_value,
nullptr);
625 p->defineAccessorProperty(
QStringLiteral(
"ownerElement"), method_ownerElement,
nullptr);
629 return d->attrPrototype.value();
669 return Encode(
int(
r->d()->d->data.size()));
675 if (
d->characterDataPrototype.isUndefined()) {
681 p->defineAccessorProperty(
QStringLiteral(
"length"), method_length,
nullptr);
682 d->characterDataPrototype.set(v4,
p);
685 return d->characterDataPrototype.value();
711 if (
d->textPrototype.isUndefined()) {
716 p->defineAccessorProperty(
QStringLiteral(
"isElementContentWhitespace"), method_isElementContentWhitespace,
nullptr);
717 p->defineAccessorProperty(
QStringLiteral(
"wholeText"), method_wholeText,
nullptr);
718 d->textPrototype.set(v4,
p);
721 return d->textPrototype.value();
728 if (
d->cdataPrototype.isUndefined()) {
733 d->cdataPrototype.set(v4,
p);
736 return d->cdataPrototype.value();
742 if (
d->documentPrototype.isUndefined()) {
747 p->defineAccessorProperty(
QStringLiteral(
"xmlVersion"), method_xmlVersion,
nullptr);
748 p->defineAccessorProperty(
QStringLiteral(
"xmlEncoding"), method_xmlEncoding,
nullptr);
749 p->defineAccessorProperty(
QStringLiteral(
"xmlStandalone"), method_xmlStandalone,
nullptr);
750 p->defineAccessorProperty(
QStringLiteral(
"documentElement"), method_documentElement,
nullptr);
751 d->documentPrototype.set(v4,
p);
754 return d->documentPrototype.value();
764 QXmlStreamReader reader(
data);
766 while (!reader.atEnd()) {
767 switch (reader.readNext()) {
768 case QXmlStreamReader::NoToken:
770 case QXmlStreamReader::Invalid:
772 case QXmlStreamReader::StartDocument:
775 document->document = document;
776 document->version = reader.documentVersion().toString();
777 document->encoding = reader.documentEncoding().toString();
778 document->isStandalone = reader.isStandaloneDocument();
780 case QXmlStreamReader::EndDocument:
782 case QXmlStreamReader::StartElement:
788 node->
name = reader.name().toString();
790 document->root = node;
797 const auto attributes = reader.attributes();
803 attr->
name =
a.name().toString();
804 attr->
data =
a.value().toString();
810 case QXmlStreamReader::EndElement:
813 case QXmlStreamReader::Characters:
820 node->
data = reader.
text().toString();
823 case QXmlStreamReader::Comment:
825 case QXmlStreamReader::DTD:
827 case QXmlStreamReader::EntityReference:
829 case QXmlStreamReader::ProcessingInstruction:
834 if (!document || reader.hasError()) {
849 return d()->d ==
nullptr;
859 if (
id.isArrayIndex()) {
862 if ((
int)
index <
r->d()->list().size()) {
879 for (
int ii = 0; ii <
r->d()->
list().
size(); ++ii) {
880 if (
r->d()->list().at(ii)->name ==
str) {
903 if (
id.isArrayIndex()) {
905 if ((
int)
index <
r->d()->d->children.size()) {
984 bool sendFlag()
const;
985 bool errorFlag()
const;
987 int replyStatus()
const;
988 QString replyStatusText()
const;
1001 bool receivedXml()
const;
1004 const QString & responseType()
const;
1005 void setResponseType(
const QString &);
1020 void requestFromUrl(
const QUrl &
url);
1029 int m_redirectCount;
1033 HeadersList m_headersList;
1034 void fillHeadersList();
1043 void readEncoding();
1047 bool m_wasConstructedWithQmlContext =
true;
1049 void dispatchCallbackNow(
Object *thisObj);
1050 static void dispatchCallbackNow(
Object *thisObj,
bool done,
bool error);
1051 void dispatchCallbackSafely();
1058 void destroyNetwork();
1068 : m_state(Unsent), m_errorFlag(
false), m_sendFlag(
false)
1101 return m_statusText;
1108 m_errorFlag =
false;
1114 m_addedHeaders.clear();
1115 dispatchCallbackNow(thisObject);
1127 m_addedHeaders.append(
name);
1133 if (!m_headersList.
isEmpty()) {
1135 for (
const HeaderPair &
header : m_headersList) {
1147 for (
const HeaderPair &
header : m_headersList) {
1156void QQmlXMLHttpRequest::fillHeadersList()
1160 m_headersList.
clear();
1163 if (pair.first ==
"set-cookie" ||
1164 pair.first ==
"set-cookie2")
1167 m_headersList << pair;
1171void QQmlXMLHttpRequest::requestFromUrl(
const QUrl &
url)
1179 if (!xhrFileWrite()) {
1180 qWarning(
"XMLHttpRequest: Using PUT on a local file is disabled by default.\n"
1181 "Set QML_XHR_ALLOW_FILE_WRITE to 1 to enable this feature.");
1185 if (!xhrFileRead()) {
1186 qWarning(
"XMLHttpRequest: Using GET on a local file is disabled by default.\n"
1187 "Set QML_XHR_ALLOW_FILE_READ to 1 to enable this feature.");
1191 qWarning(
"XMLHttpRequest: Unsupported method used on a local file");
1204 if (charsetIdx == -1) {
1212 if (semiColon == -1) {
1215 n = semiColon - charsetIdx;
1236 m_network = networkAccessManager()->
get(
request);
1238 m_network = networkAccessManager()->
head(
request);
1240 m_network = networkAccessManager()->
post(
request, m_data);
1242 m_network = networkAccessManager()->
put(
request, m_data);
1261 error(networkError);
1267 this,
SLOT(readyRead()));
1271 this,
SLOT(finished()));
1278 m_errorFlag =
false;
1280 m_redirectCount = 0;
1283 m_thisObject = thisObject;
1286 requestFromUrl(m_url);
1298 if (!(m_state ==
Unsent ||
1299 (m_state ==
Opened && !m_sendFlag) ||
1304 dispatchCallbackNow(thisObject);
1312void QQmlXMLHttpRequest::readyRead()
1323 dispatchCallbackSafely();
1326 bool wasEmpty = m_responseEntityBody.
isEmpty();
1328 if (wasEmpty && !m_responseEntityBody.
isEmpty())
1331 dispatchCallbackSafely();
1336 int idx = QNetworkReply::staticMetaObject.indexOfEnumerator(
"NetworkError");
1337 if (idx == -1)
return "EnumLookupFailed";
1339 QMetaEnum e = QNetworkReply::staticMetaObject.enumerator(idx);
1342 if (!
name)
return "EnumLookupFailed";
1374 dispatchCallbackSafely();
1381 dispatchCallbackSafely();
1384#define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION 15
1385void QQmlXMLHttpRequest::finished()
1403 requestFromUrl(
url);
1417 dispatchCallbackSafely();
1424 if (!m_responseEntityBody.
isEmpty()) {
1434 dispatchCallbackSafely();
1438 dispatchCallbackSafely();
1440 m_thisObject.
clear();
1441 m_qmlContext.
reset();
1445void QQmlXMLHttpRequest::readEncoding()
1447 for (
const HeaderPair &
header :
std::as_const(m_headersList)) {
1450 if (separatorIdx == -1) {
1453 m_mime =
header.second.
mid(0, separatorIdx);
1455 if (charsetIdx != -1) {
1458 m_charset =
header.second.
mid(charsetIdx, separatorIdx >= 0 ? separatorIdx :
header.second.
size());
1466 if (
mime.isEmpty() ||
mime ==
"text/xml" ||
mime ==
"application/xml" ||
mime.endsWith(
"+xml"))
1484 return m_overrideMime.
isEmpty() ? m_mime : m_overrideMime;
1491 return m_overrideCharset.
isEmpty() ? m_charset : m_overrideCharset;
1496 return m_responseType;
1506 if (m_parsedDocument.
isEmpty()) {
1516 m_parsedDocument.
set(scope.
engine, jsonObject);
1519 return m_parsedDocument.
value();
1524 if (m_parsedDocument.
isEmpty()) {
1528 return m_parsedDocument.
value();
1538 if (!decoder.
isValid() && m_gotXml) {
1539 QXmlStreamReader reader(m_responseEntityBody);
1541 decoder =
QStringDecoder(reader.documentEncoding().toString().toUtf8());
1562 return toUtf16(m_responseEntityBody);
1567 return m_responseEntityBody;
1570void QQmlXMLHttpRequest::dispatchCallbackNow(
Object *thisObj)
1572 dispatchCallbackNow(thisObj, m_state ==
Done, m_errorFlag);
1575void QQmlXMLHttpRequest::dispatchCallbackNow(
Object *thisObj,
bool done,
bool error)
1579 const auto dispatch = [thisObj](
const QString &eventName) {
1588 callback->call(jsCallData);
1590 if (scope.hasException()) {
1607void QQmlXMLHttpRequest::dispatchCallbackSafely()
1609 if (m_wasConstructedWithQmlContext && m_qmlContext.
isNull()) {
1617 dispatchCallbackNow(m_thisObject.
as<
Object>());
1620void QQmlXMLHttpRequest::destroyNetwork()
1625 m_network =
nullptr;
1645#define QQmlXMLHttpRequestCtorMembers(class, Member) \
1646 Member(class, Pointer, Object *, proto)
1674 w->setPrototypeUnchecked(proto);
1675 return w.asReturnedValue();
1719 if (!ctor->d()->proto)
1722 ctor->defineDefaultProperty(
s,
ScopedObject(scope, ctor->d()->proto));
1732 d()->proto.set(
scope.engine,
p->d());
1773 if (argc < 2 || argc > 5)
1793 url = qmlContextData->resolvedUrl(
url);
1888 return r->send(
w,
scope.engine->callingQmlContext(),
data);
1949 return Encode(
r->readyState());
1967 return Encode(
r->replyStatus());
1985 return Encode(
scope.engine->newString(
r->replyStatusText()));
2000 return Encode(
scope.engine->newString(
r->responseBody()));
2011 if (!
r->receivedXml() ||
2016 if (
r->responseType().isEmpty())
2018 return r->xmlResponseBody(
scope.engine);
2034 const QString& responseType =
r->responseType();
2056 return Encode(
scope.engine->newString(
r->responseType()));
2113 const auto type = parts.at(0).trimmed();
2115 const auto mimeInvalidCharacter = [](
QChar uni) {
2116 if (uni.unicode() > 127)
2118 const char ch = char(uni.unicode());
2119 return !(
ch ==
'-' ||
ch ==
'/' || isAsciiLetterOrNumber(
ch));
2124 && std::find_if(
type.begin(),
type.end(), mimeInvalidCharacter) ==
type.end()) {
2126 r->setOverrideMimeType(
type);
2128 for (
const auto &part : parts) {
2131 if (part.trimmed().startsWith(charset)) {
2133 const int offset(part.indexOf(charset) + charset.
size());
2134 r->setOverrideCharset(part.sliced(
offset).trimmed());
2161#include <qqmlxmlhttprequest.moc>
\inmodule QtCore \reentrant
void setData(const QByteArray &data)
Sets the contents of the internal buffer to be data.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
void clear()
Clears the contents of the byte array and makes it null.
QByteArray toLower() const &
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
QString text(const QString &key) const
QJSValue newObject()
Creates a JavaScript object of class Object.
constexpr qsizetype size() const noexcept
bool isEmpty() const noexcept
void append(parameter_type t)
The QNetworkAccessManager class allows the application to send network requests and receive replies.
QNetworkReply * put(const QNetworkRequest &request, QIODevice *data)
Uploads the contents of data to the destination request and returns a new QNetworkReply object that w...
QNetworkReply * head(const QNetworkRequest &request)
Posts a request to obtain the network headers for request and returns a new QNetworkReply object whic...
QNetworkReply * post(const QNetworkRequest &request, QIODevice *data)
Sends an HTTP POST request to the destination specified by request and returns a new QNetworkReply ob...
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
QNetworkReply * sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data=nullptr)
QNetworkReply * deleteResource(const QNetworkRequest &request)
QByteArray rawHeader(const QByteArray &headerName) const
Returns the raw contents of the header headerName as sent by the remote server.
QVariant attribute(QNetworkRequest::Attribute code) const
Returns the attribute associated with the code code.
NetworkError error() const
Returns the error that was found during the processing of this request.
NetworkError
Indicates all possible error conditions found during the processing of the request.
@ ContentOperationNotPermittedError
@ OperationNotImplementedError
@ ServiceUnavailableError
@ ProtocolInvalidOperationError
@ AuthenticationRequiredError
QList< QByteArray > rawHeaderList() const
Returns a list of headers fields that were sent by the remote server, in the order that they were sen...
QUrl url() const
Returns the URL of the content downloaded or uploaded.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
@ HttpStatusCodeAttribute
@ RedirectPolicyAttribute
@ RedirectionTargetAttribute
@ HttpReasonPhraseAttribute
@ SynchronousRequestAttribute
void setHeader(KnownHeaders header, const QVariant &value)
Sets the value of the known header header to be value, overriding any previously set headers.
void setAttribute(Attribute code, const QVariant &value)
Sets the attribute associated with code code to be value value.
QVariant attribute(Attribute code, const QVariant &defaultValue=QVariant()) const
Returns the attribute associated with the code code.
QVariant header(KnownHeaders header) const
Returns the value of the known network header header if it is present in this request.
void setRawHeader(const QByteArray &headerName, const QByteArray &value)
Sets the header headerName to be of value headerValue.
void setUrl(const QUrl &url)
Sets the URL this network request is referring to be url.
QByteArray rawHeader(const QByteArray &headerName) const
Returns the raw form of header headerName.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setParent(QObject *parent)
Makes the object a child of parent.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void deleteLater()
\threadsafe
void warning(const QQmlError &)
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlError class encapsulates a QML error.
static bool isLocalFile(const QString &url)
Returns true if url is a local file that can be opened with QFile.
void setOverrideCharset(QStringView charset)
void setResponseType(const QString &)
void setOverrideMimeType(QStringView mimeType)
ReturnedValue abort(Object *thisObject)
QQmlXMLHttpRequest(QNetworkAccessManager *manager, QV4::ExecutionEngine *v4)
QV4::ReturnedValue jsonResponseBody(QV4::ExecutionEngine *)
const QByteArray charset() const
quint32 readyState() const
const QByteArray & rawResponseBody() const
void addHeader(const QString &, const QString &)
virtual ~QQmlXMLHttpRequest()
QString header(const QString &name) const
QString replyStatusText() const
const QString & responseType() const
const QByteArray mimeType() const
QV4::ReturnedValue xmlResponseBody(QV4::ExecutionEngine *)
ReturnedValue send(Object *thisObject, const QQmlRefPointer< QQmlContextData > &context, const QByteArray &)
ReturnedValue open(Object *thisObject, const QString &, const QUrl &, LoadType)
T & top()
Returns a reference to the stack's top item.
T pop()
Removes the top item from the stack and returns it.
bool isValid() const noexcept
Returns true if this is a valid string converter that can be used for encoding or decoding text.
static Q_CORE_EXPORT std::optional< Encoding > encodingForData(QByteArrayView data, char16_t expectedFirstCharacter=0) noexcept
Returns the encoding for the content of data if it can be determined.
static Q_CORE_EXPORT QStringDecoder decoderForHtml(QByteArrayView data)
Tries to determine the encoding of the HTML in data by looking at leading byte order marks or a chars...
constexpr bool isEmpty() const noexcept
Returns whether this string view is empty - that is, whether {size() == 0}.
QByteArray toUtf8() const
Returns a UTF-8 representation of the string view as a QByteArray.
QStringView trimmed() const noexcept
Strips leading and trailing whitespace and returns the result.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString & replace(qsizetype i, qsizetype len, QChar after)
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
const QChar * constData() const
Returns a pointer to the data stored in the QString.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
QString first(qsizetype n) const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString toLower() const &
QString & append(QChar c)
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QByteArray toUtf8() const &
QString toUpper() const &
QString url(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
void setPassword(const QString &password, ParsingMode mode=DecodedMode)
Sets the URL's password to password.
void setUserName(const QString &userName, ParsingMode mode=DecodedMode)
Sets the URL's user name to userName.
void setFragment(const QString &fragment, ParsingMode mode=TolerantMode)
Sets the fragment of the URL to fragment.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
static ReturnedValue prototype(ExecutionEngine *)
static ReturnedValue method_name(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_value(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_ownerElement(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue prototype(ExecutionEngine *v4)
static ReturnedValue prototype(ExecutionEngine *v4)
static ReturnedValue method_length(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_documentElement(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_xmlStandalone(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue load(ExecutionEngine *engine, const QByteArray &data)
static ReturnedValue prototype(ExecutionEngine *)
static ReturnedValue method_xmlVersion(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_xmlEncoding(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue prototype(ExecutionEngine *)
ReturnedValue parse(QJsonParseError *error)
ObjectType::Data * allocate(Args &&... args)
static V4_NEEDS_DESTROY ReturnedValue create(ExecutionEngine *, NodeImpl *, const QList< NodeImpl * > &)
QList< NodeImpl * > attributes
QList< NodeImpl * > children
static ReturnedValue create(ExecutionEngine *, NodeImpl *)
static ReturnedValue method_get_childNodes(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_nodeValue(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_previousSibling(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_namespaceUri(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue getProto(ExecutionEngine *v4)
static ReturnedValue method_get_parentNode(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_nextSibling(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_nodeType(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_lastChild(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_firstChild(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_attributes(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_nodeName(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
ReturnedValue value() const
void set(ExecutionEngine *engine, const Value &value)
static ReturnedValue method_wholeText(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue prototype(ExecutionEngine *)
static ReturnedValue method_isElementContentWhitespace(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has userType() \l QMetaType::QByteArray or \l QMet...
QUrl toUrl() const
Returns the variant as a QUrl if the variant has userType() \l QMetaType::QUrl; otherwise returns an ...
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
Scoped< Object > ScopedObject
std::pair< T1, T2 > QPair
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
#define DEFINE_BOOL_CONFIG_OPTION(name, var)
static const char * errorToString(QNetworkReply::NetworkError error)
static QQmlXMLHttpRequestData * xhrdata(ExecutionEngine *v4)
void * qt_add_qmlxmlhttprequest(ExecutionEngine *v4)
void qt_rem_qmlxmlhttprequest(ExecutionEngine *, void *d)
#define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION
#define V4THROW_REFERENCE(string)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define DOMEXCEPTION_SYNTAX_ERR
#define THROW_DOM(error, string)
#define DOMEXCEPTION_INVALID_STATE_ERR
#define DECLARE_HEAP_OBJECT(name, base)
#define DECLARE_MARKOBJECTS(class)
#define THROW_TYPE_ERROR()
#define RETURN_UNDEFINED()
#define DEFINE_OBJECT_VTABLE(classname)
#define V4_OBJECT2(DataClass, superClass)
file open(QIODevice::ReadOnly)
QUrl url("example.com")
[constructor-url-reference]
application x qt windows mime
[2]
QNetworkAccessManager manager
QNetworkRequest request(url)
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
PersistentValue characterDataPrototype
PersistentValue documentPrototype
PersistentValue nodeFunction
PersistentValue elementPrototype
PersistentValue textPrototype
PersistentValue attrPrototype
PersistentValue cdataPrototype
PersistentValue nodePrototype
~QQmlXMLHttpRequestData()
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
MemoryManager * memoryManager
QQmlRefPointer< QQmlContextData > callingQmlContext() const
Heap::String * newString(const QString &s=QString())
String * id_length() const
Heap::Object * newObject()
void freezeObject(const QV4::Value &value)
Heap::ExecutionContext * scope() const
QList< NodeImpl * > * listPtr
void init(NodeImpl *data, const QList< NodeImpl * > &list)
QList< NodeImpl * > & list()
void init(NodeImpl *data)
void init(NodeImpl *data)
void init(QQmlXMLHttpRequest *request)
QQmlXMLHttpRequest * request
Heap::InternalClass * internalClass() const
ExecutionEngine * engine() const
static V4_NEEDS_DESTROY ReturnedValue create(ExecutionEngine *v4, NodeImpl *)
bool hasProperty(PropertyKey id) const
void defineReadonlyProperty(const QString &name, const Value &value)
static ReturnedValue method_getAllResponseHeaders(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_response(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_responseURL(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue virtualCall(const FunctionObject *, const Value *, const Value *, int)
static ReturnedValue method_set_responseType(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_setRequestHeader(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_readyState(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_responseText(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_open(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_overrideMimeType(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_getResponseHeader(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_responseType(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_responseXML(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_abort(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_statusText(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_get_status(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_send(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc)
QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const
constexpr ReturnedValue asReturnedValue() const
bool booleanValue() const
PropertyKey propertyKey() const
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Get virtualGet
static constexpr Value fromInt32(int i)
QString toQStringNoThrow() const