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>
23#include <QtCore/qpointer.h>
24#include <QtCore/qstringconverter.h>
25#include <QtCore/qxmlstream.h>
26#include <QtCore/qstack.h>
27#include <QtCore/qdebug.h>
28#include <QtCore/qbuffer.h>
30#include <private/qv4objectproto_p.h>
31#include <private/qv4scopedvalue_p.h>
32#include <private/qv4arraybuffer_p.h>
33#include <private/qv4jsonobject_p.h>
37#define V4THROW_REFERENCE(string) \
39 ScopedObject error(scope, scope.engine->newReferenceErrorObject(QStringLiteral(string))); \
40 return scope.engine->throwError(error); \
123 using Base1 = QQmlRefCounted<DocumentImpl>;
152 listPtr =
new QList<NodeImpl *>;
389 Scoped<Node>
r(scope, thisObject->
as<
Node>());
394 switch (
r->d()->d->type) {
405 name =
r->d()->d->name;
414 Scoped<Node>
r(scope, thisObject->
as<
Node>());
433 Scoped<Node>
r(scope, thisObject->
as<
Node>());
437 return Encode(
r->d()->d->type);
443 Scoped<Node>
r(scope, thisObject->
as<
Node>());
453 Scoped<Node>
r(scope, thisObject->
as<
Node>());
457 if (
r->d()->d->parent)
466 Scoped<Node>
r(scope, thisObject->
as<
Node>());
476 Scoped<Node>
r(scope, thisObject->
as<
Node>());
480 if (
r->d()->d->children.isEmpty())
489 Scoped<Node>
r(scope, thisObject->
as<
Node>());
493 if (
r->d()->d->children.isEmpty())
502 Scoped<Node>
r(scope, thisObject->
as<
Node>());
506 if (!
r->d()->d->parent)
509 for (
int ii = 0; ii <
r->d()->
d->parent->children.size(); ++ii) {
510 if (
r->d()->d->parent->children.at(ii) ==
r->d()->d) {
524 Scoped<Node>
r(scope, thisObject->
as<
Node>());
528 if (!
r->d()->d->parent)
531 for (
int ii = 0; ii <
r->d()->
d->parent->children.size(); ++ii) {
532 if (
r->d()->d->parent->children.at(ii) ==
r->d()->d) {
533 if ((ii + 1) ==
r->d()->d->parent->children.size())
546 Scoped<Node>
r(scope, thisObject->
as<
Node>());
560 if (
d->nodePrototype.isUndefined()) {
562 d->nodePrototype.set(v4,
p);
565 return d->nodePrototype.value();
575 switch (
data->type) {
595 instance->setPrototypeUnchecked((
p = Element::prototype(v4)));
599 return instance.asReturnedValue();
605 if (
d->elementPrototype.isUndefined()) {
614 return d->elementPrototype.value();
620 if (
d->attrPrototype.isUndefined()) {
625 p->defineAccessorProperty(
QStringLiteral(
"name"), method_name,
nullptr);
626 p->defineAccessorProperty(
QStringLiteral(
"value"), method_value,
nullptr);
627 p->defineAccessorProperty(
QStringLiteral(
"ownerElement"), method_ownerElement,
nullptr);
631 return d->attrPrototype.value();
637 Scoped<Node>
r(scope, thisObject->
as<
Node>());
647 Scoped<Node>
r(scope, thisObject->
as<
Node>());
657 Scoped<Node>
r(scope, thisObject->
as<
Node>());
667 Scoped<Node>
r(scope, thisObject->
as<
Node>());
671 return Encode(
int(
r->d()->d->data.size()));
677 if (
d->characterDataPrototype.isUndefined()) {
683 p->defineAccessorProperty(
QStringLiteral(
"length"), method_length,
nullptr);
684 d->characterDataPrototype.set(v4,
p);
687 return d->characterDataPrototype.value();
693 Scoped<Node>
r(scope, thisObject->
as<
Node>());
703 Scoped<Node>
r(scope, thisObject->
as<
Node>());
713 if (
d->textPrototype.isUndefined()) {
718 p->defineAccessorProperty(
QStringLiteral(
"isElementContentWhitespace"), method_isElementContentWhitespace,
nullptr);
719 p->defineAccessorProperty(
QStringLiteral(
"wholeText"), method_wholeText,
nullptr);
720 d->textPrototype.set(v4,
p);
723 return d->textPrototype.value();
730 if (
d->cdataPrototype.isUndefined()) {
735 d->cdataPrototype.set(v4,
p);
738 return d->cdataPrototype.value();
744 if (
d->documentPrototype.isUndefined()) {
749 p->defineAccessorProperty(
QStringLiteral(
"xmlVersion"), method_xmlVersion,
nullptr);
750 p->defineAccessorProperty(
QStringLiteral(
"xmlEncoding"), method_xmlEncoding,
nullptr);
751 p->defineAccessorProperty(
QStringLiteral(
"xmlStandalone"), method_xmlStandalone,
nullptr);
752 p->defineAccessorProperty(
QStringLiteral(
"documentElement"), method_documentElement,
nullptr);
753 d->documentPrototype.set(v4,
p);
756 return d->documentPrototype.value();
764 QStack<NodeImpl *> nodeStack;
766 QXmlStreamReader reader(
data);
768 while (!reader.atEnd()) {
769 switch (reader.readNext()) {
770 case QXmlStreamReader::NoToken:
772 case QXmlStreamReader::Invalid:
774 case QXmlStreamReader::StartDocument:
777 document->document = document;
778 document->version = reader.documentVersion().toString();
779 document->encoding = reader.documentEncoding().toString();
780 document->isStandalone = reader.isStandaloneDocument();
782 case QXmlStreamReader::EndDocument:
784 case QXmlStreamReader::StartElement:
790 node->
name = reader.name().toString();
791 if (nodeStack.isEmpty()) {
792 document->root = node;
794 node->
parent = nodeStack.top();
797 nodeStack.append(node);
799 const auto attributes = reader.attributes();
800 for (
const QXmlStreamAttribute &
a : attributes) {
805 attr->
name =
a.name().toString();
806 attr->
data =
a.value().toString();
812 case QXmlStreamReader::EndElement:
815 case QXmlStreamReader::Characters:
820 node->
parent = nodeStack.top();
822 node->
data = reader.
text().toString();
825 case QXmlStreamReader::Comment:
827 case QXmlStreamReader::DTD:
829 case QXmlStreamReader::EntityReference:
831 case QXmlStreamReader::ProcessingInstruction:
836 if (!document || reader.hasError()) {
851 return d()->d ==
nullptr;
861 if (
id.isArrayIndex()) {
864 if ((
int)
index <
r->d()->list().size()) {
881 for (
int ii = 0; ii <
r->d()->
list().
size(); ++ii) {
882 if (
r->d()->list().at(ii)->name ==
str) {
905 if (
id.isArrayIndex()) {
907 if ((
int)
index <
r->d()->d->children.size()) {
930 Scoped<Node>
r(scope, thisObject->
as<
Node>());
940 Scoped<Node>
r(scope, thisObject->
as<
Node>());
950 Scoped<Node>
r(scope, thisObject->
as<
Node>());
960 Scoped<Node>
r(scope, thisObject->
as<
Node>());
986 bool sendFlag()
const;
987 bool errorFlag()
const;
989 int replyStatus()
const;
990 QString replyStatusText()
const;
1003 bool receivedXml()
const;
1006 const QString & responseType()
const;
1007 void setResponseType(
const QString &);
1022 void requestFromUrl(
const QUrl &
url);
1031 int m_redirectCount;
1033 typedef QPair<QByteArray, QByteArray> HeaderPair;
1034 typedef QList<HeaderPair> HeadersList;
1035 HeadersList m_headersList;
1036 void fillHeadersList();
1045 void readEncoding();
1048 QQmlRefPointer<QQmlContextData> m_qmlContext;
1049 bool m_wasConstructedWithQmlContext =
true;
1051 void dispatchCallbackNow(
Object *thisObj);
1052 static void dispatchCallbackNow(
Object *thisObj,
bool done,
bool error);
1053 void dispatchCallbackSafely();
1059 QPointer<QNetworkReply> m_network;
1060 void destroyNetwork();
1070 : m_state(Unsent), m_errorFlag(
false), m_sendFlag(
false)
1103 return m_statusText;
1110 m_errorFlag =
false;
1116 m_addedHeaders.clear();
1117 dispatchCallbackNow(thisObject);
1129 m_addedHeaders.append(
name);
1135 if (!m_headersList.
isEmpty()) {
1137 for (
const HeaderPair &
header : m_headersList) {
1149 for (
const HeaderPair &
header : m_headersList) {
1158void QQmlXMLHttpRequest::fillHeadersList()
1160 const QList<QByteArray> headerList = m_network->
rawHeaderList();
1162 m_headersList.
clear();
1165 if (pair.first ==
"set-cookie" ||
1166 pair.first ==
"set-cookie2")
1169 m_headersList << pair;
1173void QQmlXMLHttpRequest::requestFromUrl(
const QUrl &
url)
1181 if (!xhrFileWrite()) {
1182 qWarning(
"XMLHttpRequest: Using PUT on a local file is disabled by default.\n"
1183 "Set QML_XHR_ALLOW_FILE_WRITE to 1 to enable this feature.");
1187 if (!xhrFileRead()) {
1188 qWarning(
"XMLHttpRequest: Using GET on a local file is disabled by default.\n"
1189 "Set QML_XHR_ALLOW_FILE_READ to 1 to enable this feature.");
1193 qWarning(
"XMLHttpRequest: Unsupported method used on a local file");
1206 if (charsetIdx == -1) {
1214 if (semiColon == -1) {
1217 n = semiColon - charsetIdx;
1238 m_network = networkAccessManager()->
get(
request);
1240 m_network = networkAccessManager()->
head(
request);
1242 m_network = networkAccessManager()->
post(
request, m_data);
1244 m_network = networkAccessManager()->
put(
request, m_data);
1263 error(networkError);
1269 this,
SLOT(readyRead()));
1273 this,
SLOT(finished()));
1280 m_errorFlag =
false;
1282 m_redirectCount = 0;
1285 m_thisObject = thisObject;
1288 requestFromUrl(m_url);
1300 if (!(m_state ==
Unsent ||
1301 (m_state ==
Opened && !m_sendFlag) ||
1306 dispatchCallbackNow(thisObject);
1314void QQmlXMLHttpRequest::readyRead()
1325 dispatchCallbackSafely();
1328 bool wasEmpty = m_responseEntityBody.
isEmpty();
1330 if (wasEmpty && !m_responseEntityBody.
isEmpty())
1333 dispatchCallbackSafely();
1338 int idx = QNetworkReply::staticMetaObject.indexOfEnumerator(
"NetworkError");
1339 if (idx == -1)
return "EnumLookupFailed";
1341 QMetaEnum e = QNetworkReply::staticMetaObject.enumerator(idx);
1344 if (!
name)
return "EnumLookupFailed";
1376 dispatchCallbackSafely();
1383 dispatchCallbackSafely();
1386#define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION 15
1387void QQmlXMLHttpRequest::finished()
1405 requestFromUrl(
url);
1419 dispatchCallbackSafely();
1426 if (!m_responseEntityBody.
isEmpty()) {
1436 dispatchCallbackSafely();
1440 dispatchCallbackSafely();
1442 m_thisObject.
clear();
1443 m_qmlContext.
reset();
1447void QQmlXMLHttpRequest::readEncoding()
1449 for (
const HeaderPair &
header :
std::as_const(m_headersList)) {
1452 if (separatorIdx == -1) {
1455 m_mime =
header.second.
mid(0, separatorIdx);
1457 if (charsetIdx != -1) {
1460 m_charset =
header.second.
mid(charsetIdx, separatorIdx >= 0 ? separatorIdx :
header.second.
size());
1468 if (
mime.isEmpty() ||
mime ==
"text/xml" ||
mime ==
"application/xml" ||
mime.endsWith(
"+xml"))
1486 return m_overrideMime.
isEmpty() ? m_mime : m_overrideMime;
1493 return m_overrideCharset.
isEmpty() ? m_charset : m_overrideCharset;
1498 return m_responseType;
1508 if (m_parsedDocument.
isEmpty()) {
1518 m_parsedDocument.
set(scope.
engine, jsonObject);
1521 return m_parsedDocument.
value();
1526 if (m_parsedDocument.
isEmpty()) {
1530 return m_parsedDocument.
value();
1540 if (!decoder.
isValid() && m_gotXml) {
1541 QXmlStreamReader reader(m_responseEntityBody);
1543 decoder =
QStringDecoder(reader.documentEncoding().toString().toUtf8());
1564 return toUtf16(m_responseEntityBody);
1569 return m_responseEntityBody;
1572void QQmlXMLHttpRequest::dispatchCallbackNow(
Object *thisObj)
1574 dispatchCallbackNow(thisObj, m_state ==
Done, m_errorFlag);
1577void QQmlXMLHttpRequest::dispatchCallbackNow(
Object *thisObj,
bool done,
bool error)
1581 const auto dispatch = [thisObj](
const QString &eventName) {
1590 callback->call(jsCallData);
1592 if (scope.hasException()) {
1609void QQmlXMLHttpRequest::dispatchCallbackSafely()
1611 if (m_wasConstructedWithQmlContext && m_qmlContext.
isNull()) {
1619 dispatchCallbackNow(m_thisObject.
as<
Object>());
1622void QQmlXMLHttpRequest::destroyNetwork()
1627 m_network =
nullptr;
1647#define QQmlXMLHttpRequestCtorMembers(class, Member) \
1648 Member(class, Pointer, Object *, proto)
1670 Scope scope(
f->engine());
1676 w->setPrototypeUnchecked(proto);
1677 return w.asReturnedValue();
1713 Scoped<QV4::QQmlXMLHttpRequestCtor> ctor(scope,
this);
1721 if (!ctor->d()->proto)
1724 ctor->defineDefaultProperty(
s,
ScopedObject(scope, ctor->d()->proto));
1734 d()->proto.set(scope.
engine,
p->d());
1775 if (argc < 2 || argc > 5)
1795 url = qmlContextData->resolvedUrl(
url);
1951 return Encode(
r->readyState());
1969 return Encode(
r->replyStatus());
2013 if (!
r->receivedXml() ||
2018 if (
r->responseType().isEmpty())
2020 return r->xmlResponseBody(scope.
engine);
2036 const QString& responseType =
r->responseType();
2115 const auto type = parts.at(0).trimmed();
2117 const auto mimeInvalidCharacter = [](
QChar uni) {
2118 if (uni.unicode() > 127)
2120 const char ch = char(uni.unicode());
2121 return !(
ch ==
'-' ||
ch ==
'/' || isAsciiLetterOrNumber(
ch));
2126 && std::find_if(
type.begin(),
type.end(), mimeInvalidCharacter) ==
type.end()) {
2128 r->setOverrideMimeType(
type);
2130 for (
const auto &part : parts) {
2133 if (part.trimmed().startsWith(charset)) {
2135 const int offset(part.indexOf(charset) + charset.
size());
2136 r->setOverrideCharset(part.sliced(
offset).trimmed());
2163#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 startsWith(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
bool isEmpty() const noexcept
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(QAnyStringView 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.
QByteArray rawHeader(QAnyStringView headerName) const
Returns the raw form of header headerName.
void setUrl(const QUrl &url)
Sets the URL this network request is referring to be url.
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 \l{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)
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
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
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 ...
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.
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const noexcept
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 first(qsizetype n) const &
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString toLower() const &
QString & append(QChar c)
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)
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.
Scoped< FunctionObject > ScopedFunctionObject
Scoped< Object > ScopedObject
Scoped< String > ScopedString
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)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
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
String * id_length() const
Heap::Object * newObject()
Heap::String * newString(char16_t c)
QUrl resolvedUrl(const QString &file)
void freezeObject(const QV4::Value &value)
Heap::ArrayBuffer * newArrayBuffer(const QByteArray &array)
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 setPrototypeUnchecked(const Object *p)
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
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