Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qhttpthreaddelegate.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4//#define QHTTPTHREADDELEGATE_DEBUG
6
7#include <QThread>
8#include <QTimer>
9#include <QAuthenticator>
10#include <QEventLoop>
11#include <QCryptographicHash>
12
13#include "private/qhttpnetworkreply_p.h"
14#include "private/qnetworkaccesscache_p.h"
15#include "private/qnoncontiguousbytedevice_p.h"
16
18
19using namespace Qt::StringLiterals;
20
21static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
22{
24 // we've got an error
25 switch (httpStatusCode) {
26 case 400: // Bad Request
28 break;
29
30 case 401: // Authorization required
32 break;
33
34 case 403: // Access denied
36 break;
37
38 case 404: // Not Found
40 break;
41
42 case 405: // Method Not Allowed
44 break;
45
46 case 407:
48 break;
49
50 case 409: // Resource Conflict
52 break;
53
54 case 410: // Content no longer available
56 break;
57
58 case 418: // I'm a teapot
60 break;
61
62 case 500: // Internal Server Error
64 break;
65
66 case 501: // Server does not support this functionality
68 break;
69
70 case 503: // Service unavailable
72 break;
73
74 default:
75 if (httpStatusCode > 500) {
76 // some kind of server error
78 } else if (httpStatusCode >= 400) {
79 // content error we did not handle above
81 } else {
82 qWarning("QNetworkAccess: got HTTP status code %d which is not expected from url: \"%s\"",
83 httpStatusCode, qPrintable(url.toString()));
85 }
86 }
87
88 return code;
89}
90
91
92static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy, const QString &peerVerifyName)
93{
95 QUrl copy = url;
96 QString scheme = copy.scheme();
97 bool isEncrypted = scheme == "https"_L1 || scheme == "preconnect-https"_L1;
98 copy.setPort(copy.port(isEncrypted ? 443 : 80));
99 if (scheme == "preconnect-http"_L1)
100 copy.setScheme("http"_L1);
101 else if (scheme == "preconnect-https"_L1)
102 copy.setScheme("https"_L1);
105
106#ifndef QT_NO_NETWORKPROXY
107 if (proxy && proxy->type() != QNetworkProxy::NoProxy) {
108 QUrl key;
109
110 switch (proxy->type()) {
112 key.setScheme("proxy-socks5"_L1);
113 break;
114
117 key.setScheme("proxy-http"_L1);
118 break;
119
120 default:
121 break;
122 }
123
124 if (!key.scheme().isEmpty()) {
125 const QByteArray obfuscatedPassword = QCryptographicHash::hash(proxy->password().toUtf8(),
127 key.setUserName(proxy->user());
128 key.setPassword(QString::fromUtf8(obfuscatedPassword));
129 key.setHost(proxy->hostName());
130 key.setPort(proxy->port());
131 key.setQuery(result);
132 result = key.toString(QUrl::FullyEncoded);
133 }
134 }
135#else
137#endif
138 if (!peerVerifyName.isEmpty())
139 result += u':' + peerVerifyName;
140 return "http-connection:" + std::move(result).toLatin1();
141}
142
145{
146 // Q_OBJECT
147public:
150 : QHttpNetworkConnection(connectionCount, hostName, port, encrypt, /*parent=*/nullptr, connectionType)
151 {
152 setExpires(true);
153 setShareable(true);
154 }
155
156 virtual void dispose() override
157 {
158#if 0 // sample code; do this right with the API
159 Q_ASSERT(!isWorking());
160#endif
161 delete this;
162 }
163};
164
165
167
168
170{
171 // It could be that the main thread has asked us to shut down, so we need to delete the HTTP reply
172 if (httpReply) {
173 delete httpReply;
174 }
175
176 // Get the object cache that stores our QHttpNetworkConnection objects
177 // and release the entry for this QHttpNetworkConnection
180 }
181}
182
183
186 , ssl(false)
187 , downloadBufferMaximumSize(0)
188 , readBufferMaxSize(0)
189 , bytesEmitted(0)
190 , pendingDownloadData()
191 , pendingDownloadProgress()
192 , synchronous(false)
193 , connectionCacheExpiryTimeoutSeconds(-1)
194 , incomingStatusCode(0)
195 , isPipeliningUsed(false)
196 , isHttp2Used(false)
197 , incomingContentLength(-1)
198 , removedContentLength(-1)
199 , incomingErrorCode(QNetworkReply::NoError)
200 , downloadBuffer()
201 , httpConnection(nullptr)
202 , httpReply(nullptr)
203 , synchronousRequestLoop(nullptr)
204{
205}
206
207// This is invoked as BlockingQueuedConnection from QNetworkAccessHttpBackend in the user thread
209{
210#ifdef QHTTPTHREADDELEGATE_DEBUG
211 qDebug() << "QHttpThreadDelegate::startRequestSynchronously() thread=" << QThread::currentThreadId();
212#endif
213 synchronous = true;
214
216 this->synchronousRequestLoop = &synchronousRequestLoop;
217
218 // Worst case timeout
219 QTimer::singleShot(30*1000, this, SLOT(abortRequest()));
220
221 QMetaObject::invokeMethod(this, "startRequest", Qt::QueuedConnection);
223
225 connections.setLocalData(nullptr);
226
227#ifdef QHTTPTHREADDELEGATE_DEBUG
228 qDebug() << "QHttpThreadDelegate::startRequestSynchronously() thread=" << QThread::currentThreadId() << "finished";
229#endif
230}
231
232
233// This is invoked as QueuedConnection from QNetworkAccessHttpBackend in the user thread
235{
236#ifdef QHTTPTHREADDELEGATE_DEBUG
237 qDebug() << "QHttpThreadDelegate::startRequest() thread=" << QThread::currentThreadId();
238#endif
239 // Check QThreadStorage for the QNetworkAccessCache
240 // If not there, create this connection cache
241 if (!connections.hasLocalData()) {
243 }
244
245 // check if we have an open connection to this host
246 QUrl urlCopy = httpRequest.url();
247 urlCopy.setPort(urlCopy.port(ssl ? 443 : 80));
248
255 }
256
257 // Use HTTP/1.1 if h2c is not allowed and we would otherwise choose to use it
258 if (!ssl && connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2
261 }
262
263#if QT_CONFIG(ssl)
264 // See qnetworkreplyhttpimpl, delegate's initialization code.
266#endif // QT_CONFIG(ssl)
267
268 const bool isH2 = httpRequest.isHTTP2Allowed() || httpRequest.isHTTP2Direct();
269 if (isH2) {
270#if QT_CONFIG(ssl)
271 if (ssl) {
272 if (!httpRequest.isHTTP2Direct()) {
273 QList<QByteArray> protocols;
277 }
278 urlCopy.setScheme(QStringLiteral("h2s"));
279 } else
280#endif // QT_CONFIG(ssl)
281 {
282 urlCopy.setScheme(QStringLiteral("h2"));
283 }
284 }
285
286#ifndef QT_NO_NETWORKPROXY
291 else
292#endif
293 cacheKey = makeCacheKey(urlCopy, nullptr, httpRequest.peerVerifyName());
294
295 // the http object is actually a QHttpNetworkConnection
297 if (!httpConnection) {
298 // no entry in cache; create an object
299 // the http object is actually a QHttpNetworkConnection
301 connectionType);
305 }
306#ifndef QT_NO_SSL
307 // Set the QSslConfiguration from this QNetworkRequest.
308 if (ssl)
310#endif
311
312#ifndef QT_NO_NETWORKPROXY
315#endif
317 // cache the QHttpNetworkConnection corresponding to this cache key
319 } else {
321 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), nullptr);
322 if (!credential.user.isEmpty() && !credential.password.isEmpty()) {
323 QAuthenticator auth;
324 auth.setUser(credential.user);
325 auth.setPassword(credential.password);
326 httpConnection->d_func()->copyCredentials(-1, &auth, false);
327 }
328 }
329 }
330
331 // Send the request to the connection
333 httpReply->setParent(this);
334
335 // Connect the reply signals that we need to handle and then forward
336 if (synchronous) {
337 connect(httpReply,SIGNAL(headerChanged()), this, SLOT(synchronousHeaderChangedSlot()));
338 connect(httpReply,SIGNAL(finished()), this, SLOT(synchronousFinishedSlot()));
341
344#ifndef QT_NO_NETWORKPROXY
347#endif
348
349 // Don't care about ignored SSL errors for now in the synchronous HTTP case.
350 } else if (!synchronous) {
353 connect(httpReply,SIGNAL(headerChanged()), this, SLOT(headerChangedSlot()));
354 connect(httpReply,SIGNAL(finished()), this, SLOT(finishedSlot()));
357 // some signals are only interesting when normal asynchronous style is used
358 connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
360#ifndef QT_NO_SSL
365#endif
366
367 // In the asynchronous HTTP case we can just forward those signals
368 // Connect the reply signals that we can directly forward
371#ifndef QT_NO_NETWORKPROXY
374#endif
375 }
376
380 if (synchronous)
382 else
384 }
385}
386
387// This gets called from the user thread or by the synchronous HTTP timeout timer
389{
390#ifdef QHTTPTHREADDELEGATE_DEBUG
391 qDebug() << "QHttpThreadDelegate::abortRequest() thread=" << QThread::currentThreadId() << "sync=" << synchronous;
392#endif
393 if (httpReply) {
394 httpReply->abort();
395 delete httpReply;
396 httpReply = nullptr;
397 }
398
399 // Got aborted by the timeout timer
400 if (synchronous) {
403 } else {
404 //only delete this for asynchronous mode or QNetworkAccessHttpBackend will crash - see QNetworkAccessHttpBackend::postRequest()
405 this->deleteLater();
406 }
407}
408
410{
411#ifdef QHTTPTHREADDELEGATE_DEBUG
412 qDebug() << "QHttpThreadDelegate::readBufferSizeChanged() size " << size;
413#endif
414 if (httpReply) {
418 }
419}
420
422{
423 if (readBufferMaxSize) {
425
426 QMetaObject::invokeMethod(this, "readyReadSlot", Qt::QueuedConnection);
427 }
428}
429
431{
432 if (!httpReply)
433 return;
434
435 // Don't do in zerocopy case
436 if (!downloadBuffer.isNull())
437 return;
438
439 if (readBufferMaxSize) {
441 qint64 sizeEmitted = 0;
442 while (httpReply->readAnyAvailable() && (sizeEmitted < (readBufferMaxSize-bytesEmitted))) {
444 sizeEmitted = readBufferMaxSize-bytesEmitted;
445 bytesEmitted += sizeEmitted;
446 pendingDownloadData->fetchAndAddRelease(1);
447 emit downloadData(httpReply->read(sizeEmitted));
448 } else {
449 sizeEmitted = httpReply->sizeNextBlock();
450 bytesEmitted += sizeEmitted;
451 pendingDownloadData->fetchAndAddRelease(1);
453 }
454 }
455 } else {
456 // We need to wait until we empty data from the read buffer in the reply.
457 }
458
459 } else {
460 while (httpReply->readAnyAvailable()) {
461 pendingDownloadData->fetchAndAddRelease(1);
463 }
464 }
465}
466
468{
469 if (!httpReply)
470 return;
471
472#ifdef QHTTPTHREADDELEGATE_DEBUG
473 qDebug() << "QHttpThreadDelegate::finishedSlot() thread=" << QThread::currentThreadId() << "result=" << httpReply->statusCode();
474#endif
475
476 // If there is still some data left emit that now
477 while (httpReply->readAnyAvailable()) {
478 pendingDownloadData->fetchAndAddRelease(1);
480 }
481
482#ifndef QT_NO_SSL
483 if (ssl)
485#endif
486
487 if (httpReply->statusCode() >= 400) {
488 // it's an error reply
489 QString msg = QLatin1StringView(QT_TRANSLATE_NOOP("QNetworkReply",
490 "Error transferring %1 - server replied: %2"));
493 }
494
497
499
502 httpReply = nullptr;
503}
504
506{
507 if (!httpReply)
508 return;
509
510#ifdef QHTTPTHREADDELEGATE_DEBUG
511 qDebug() << "QHttpThreadDelegate::synchronousFinishedSlot() thread=" << QThread::currentThreadId() << "result=" << httpReply->statusCode();
512#endif
513 if (httpReply->statusCode() >= 400) {
514 // it's an error reply
515 QString msg = QLatin1StringView(QT_TRANSLATE_NOOP("QNetworkReply",
516 "Error transferring %1 - server replied: %2"));
519 }
520
523
526 httpReply = nullptr;
527}
528
530{
531 if (!httpReply)
532 return;
533
534#ifdef QHTTPTHREADDELEGATE_DEBUG
535 qDebug() << "QHttpThreadDelegate::finishedWithErrorSlot() thread=" << QThread::currentThreadId() << "error=" << errorCode << detail;
536#endif
537
538#ifndef QT_NO_SSL
539 if (ssl)
541#endif
542 emit error(errorCode,detail);
544
545
548 httpReply = nullptr;
549}
550
551
553{
554 if (!httpReply)
555 return;
556
557#ifdef QHTTPTHREADDELEGATE_DEBUG
558 qDebug() << "QHttpThreadDelegate::synchronousFinishedWithErrorSlot() thread=" << QThread::currentThreadId() << "error=" << errorCode << detail;
559#endif
560 incomingErrorCode = errorCode;
562
564
567 httpReply = nullptr;
568}
569
571{
572 if (!httpReply)
573 return;
574
575#ifdef QHTTPTHREADDELEGATE_DEBUG
576 qDebug() << "QHttpThreadDelegate::headerChangedSlot() thread=" << QThread::currentThreadId();
577#endif
578
579#ifndef QT_NO_SSL
580 if (ssl)
582#endif
583
584 // Is using a zerocopy buffer allowed by user and possible with this reply?
587 QT_TRY {
588 char *buf = new char[httpReply->contentLength()]; // throws if allocation fails
589 if (buf) {
590 downloadBuffer = QSharedPointer<char>(buf, [](auto p) { delete[] p; });
592 }
593 } QT_CATCH(const std::bad_alloc &) {
594 // in out of memory situations, don't use downloadbuffer.
595 }
596 }
597
598 // We fetch this into our own
607
617}
618
620{
621 if (!httpReply)
622 return;
623
624#ifdef QHTTPTHREADDELEGATE_DEBUG
625 qDebug() << "QHttpThreadDelegate::synchronousHeaderChangedSlot() thread=" << QThread::currentThreadId();
626#endif
627 // Store the information we need in this object, the QNetworkAccessHttpBackend will later read it
634}
635
636
638{
639 // If we don't have a download buffer don't attempt to go this codepath
640 // It is not used by QNetworkAccessHttpBackend
642 return;
643
644 pendingDownloadProgress->fetchAndAddRelease(1);
645 emit downloadProgress(done, total);
646}
647
649{
650 authenticationManager->cacheCredentials(request.url(), authenticator);
651}
652
653
654#ifndef QT_NO_SSL
656{
657 if (!httpReply)
658 return;
659
661 emit encrypted();
662}
663
665{
666 if (!httpReply)
667 return;
668
670
671 bool ignoreAll = false;
672 QList<QSslError> specificErrors;
673 emit sslErrors(errors, &ignoreAll, &specificErrors);
674 if (ignoreAll)
676 if (!specificErrors.isEmpty())
677 httpReply->ignoreSslErrors(specificErrors);
678}
679
681{
682 if (!httpReply)
683 return;
684
686}
687#endif
688
690{
691 if (!httpReply)
692 return;
693
695#ifdef QHTTPTHREADDELEGATE_DEBUG
696 qDebug() << "QHttpThreadDelegate::synchronousAuthenticationRequiredSlot() thread=" << QThread::currentThreadId();
697#endif
698
699 // Ask the credential cache
700 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), a);
701 if (!credential.isNull()) {
702 a->setUser(credential.user);
703 a->setPassword(credential.password);
704 }
705
706 // Disconnect this connection now since we only want to ask the authentication cache once.
709}
710
711#ifndef QT_NO_NETWORKPROXY
713{
714 if (!httpReply)
715 return;
716
717#ifdef QHTTPTHREADDELEGATE_DEBUG
718 qDebug() << "QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot() thread=" << QThread::currentThreadId();
719#endif
720 // Ask the credential cache
721 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedProxyCredentials(p, a);
722 if (!credential.isNull()) {
723 a->setUser(credential.user);
724 a->setPassword(credential.password);
725 }
726
727#ifndef QT_NO_NETWORKPROXY
728 // Disconnect this connection now since we only want to ask the authentication cache once.
731#endif
732}
733
734#endif
735
737
738#include "moc_qhttpthreaddelegate_p.cpp"
The QAuthenticator class provides an authentication object.
void setPassword(const QString &password)
Sets the password used for authentication.
void setUser(const QString &user)
Sets the user used for authentication.
\inmodule QtCore
Definition qbytearray.h:57
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
Definition qbytearray.h:106
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
static QByteArray hash(QByteArrayView data, Algorithm method)
Returns the hash of data using method.
\inmodule QtCore
Definition qeventloop.h:16
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
Q_NETWORK_EXPORT qsizetype numberOfConnectionsPerHost() const
Returns the number of connections used per http(s) {host}:{port} combination.
QHttpNetworkReply * sendRequest(const QHttpNetworkRequest &request)
void setCacheProxy(const QNetworkProxy &networkProxy)
void setPeerVerifyName(const QString &peerName)
void setTransparentProxy(const QNetworkProxy &networkProxy)
void setHttp2Parameters(const QHttp2Configuration &params)
void setSslConfiguration(const QSslConfiguration &config)
QString errorString() const
bool readAnyAvailable() const
qint64 removedContentLength() const
QByteArray read(qint64 amount)
bool isPipeliningUsed() const
void setUserProvidedDownloadBuffer(char *)
void setReadBufferSize(qint64 size)
QNetworkReply::NetworkError errorCode() const
bool supportsUserProvidedDownloadBuffer()
void setDownstreamLimited(bool t)
QString reasonPhrase() const
qint64 contentLength() const override
QList< QPair< QByteArray, QByteArray > > header() const override
QSslConfiguration sslConfiguration() const
QHttpNetworkRequest request() const
QUrl url() const override
QList< QPair< QByteArray, QByteArray > > incomingHeaders
void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator)
QSharedPointer< char > downloadBuffer
QHttpNetworkReply * httpReply
void readBufferSizeChanged(qint64 size)
void synchronousAuthenticationRequiredSlot(const QHttpNetworkRequest &request, QAuthenticator *)
void synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail=QString())
void socketStartedConnecting()
QScopedPointer< QSslConfiguration > incomingSslConfiguration
std::shared_ptr< QAtomicInt > pendingDownloadData
void sslErrorsSlot(const QList< QSslError > &errors)
QNetworkAccessCachedHttpConnection * httpConnection
void redirected(const QUrl &url, int httpStatus, int maxRedirectsRemainig)
void downloadProgress(qint64, qint64)
QHttpNetworkRequest httpRequest
void downloadMetaData(const QList< QPair< QByteArray, QByteArray > > &, int, const QString &, bool, QSharedPointer< char >, qint64, qint64, bool, bool)
void preSharedKeyAuthenticationRequiredSlot(QSslPreSharedKeyAuthenticator *authenticator)
QHttp1Configuration http1Parameters
QHttpThreadDelegate(QObject *parent=nullptr)
void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)
void sslErrors(const QList< QSslError > &, bool *, QList< QSslError > *)
void error(QNetworkReply::NetworkError, const QString &)
void synchronousProxyAuthenticationRequiredSlot(const QNetworkProxy &, QAuthenticator *)
void finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail=QString())
void authenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *)
void readBufferFreed(qint64 size)
QHttp2Configuration http2Parameters
static QThreadStorage< QNetworkAccessCache * > connections
std::shared_ptr< QAtomicInt > pendingDownloadProgress
QNetworkReply::NetworkError incomingErrorCode
void downloadData(const QByteArray &)
std::shared_ptr< QNetworkAccessAuthenticationManager > authenticationManager
void dataReadProgressSlot(qint64 done, qint64 total)
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *)
void sslConfigurationChanged(const QSslConfiguration &)
Definition qlist.h:74
bool isEmpty() const noexcept
Definition qlist.h:390
CacheableObject * requestEntryNow(const QByteArray &key)
void addEntry(const QByteArray &key, CacheableObject *entry, qint64 connectionCacheExpiryTimeoutSeconds=-1)
void releaseEntry(const QByteArray &key)
QNetworkAccessCachedHttpConnection(quint16 connectionCount, const QString &hostName, quint16 port, bool encrypt, QHttpNetworkConnection::ConnectionType connectionType)
The QNetworkProxy class provides a network layer proxy.
QString user() const
Returns the user name used for authentication.
QNetworkProxy::ProxyType type() const
Returns the proxy type for this instance.
QString password() const
Returns the password used for authentication.
QString hostName() const
Returns the host name of the proxy host.
quint16 port() const
Returns the port of the proxy host.
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
NetworkError
Indicates all possible error conditions found during the processing of the request.
@ ContentOperationNotPermittedError
@ OperationNotImplementedError
@ ProtocolInvalidOperationError
@ ProxyAuthenticationRequiredError
@ AuthenticationRequiredError
QUrl url() const
Returns the URL this network request is referring to.
\inmodule QtCore
Definition qobject.h:90
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2142
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
Definition qobject.cpp:3099
void deleteLater()
\threadsafe
Definition qobject.cpp:2352
T * data() const noexcept
Returns the value of the pointer referenced by this object.
\inmodule QtCore
bool isNull() const noexcept
Returns true if this object refers to \nullptr.
static const char ALPNProtocolHTTP2[]
void setAllowedNextProtocols(const QList< QByteArray > &protocols)
static const char NextProtocolHttp1_1[]
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QByteArray toLatin1() const &
Definition qstring.h:559
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5857
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8606
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
QByteArray toUtf8() const &
Definition qstring.h:563
\inmodule QtCore
bool hasLocalData() const
If T is a pointer type, returns true if the calling thread has non-zero data available.
void setLocalData(T t)
Sets the local data for the calling thread to data.
T & localData()
Returns a reference to the data that was set by the calling thread.
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
Definition qthread.h:154
bool singleShot
whether the timer is a single-shot timer
Definition qtimer.h:22
\inmodule QtCore
Definition qurl.h:94
QString host(ComponentFormattingOptions=FullyDecoded) const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
Definition qurl.cpp:2337
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
Definition qurl.cpp:1959
@ RemoveFragment
Definition qurl.h:112
@ RemoveQuery
Definition qurl.h:111
@ RemovePath
Definition qurl.h:110
@ RemoveUserInfo
Definition qurl.h:107
int port(int defaultPort=-1) const
Definition qurl.cpp:2380
@ FullyEncoded
Definition qurl.h:129
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
Definition qurl.cpp:2828
void setPort(int port)
Sets the port of the URL to port.
Definition qurl.cpp:2355
Combined button and popup list for selecting options.
@ QueuedConnection
static jboolean copy(JNIEnv *, jobject)
EGLOutputPortEXT port
#define QT_CATCH(A)
#define QT_TRY
static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy, const QString &peerVerifyName)
#define qDebug
[1]
Definition qlogging.h:160
#define qWarning
Definition qlogging.h:162
static bool isEncrypted(const my_mach_header *header)
#define SLOT(a)
Definition qobjectdefs.h:51
#define SIGNAL(a)
Definition qobjectdefs.h:52
GLuint64 key
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define qPrintable(string)
Definition qstring.h:1391
#define QStringLiteral(str)
@ NoError
Definition main.cpp:34
static bool ignoreAll
#define emit
#define Q_UNUSED(x)
#define QT_TRANSLATE_NOOP(scope, x)
unsigned short quint16
Definition qtypes.h:43
long long qint64
Definition qtypes.h:55
QUrl url("example.com")
[constructor-url-reference]
QObject::connect nullptr
QNetworkRequest request(url)
QNetworkProxy proxy
[0]
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(nullptr), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
\threadsafe This is an overloaded member function, provided for convenience. It differs from the abov...
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent