4#ifndef QQMLDATABLOB_P_H
5#define QQMLDATABLOB_P_H
18#include <private/qqmlrefcount_p.h>
19#include <private/qqmljsdiagnosticmessage_p.h>
21#if QT_CONFIG(qml_network)
22#include <QtNetwork/qnetworkreply.h>
25#include <QtQml/qqmlprivate.h>
26#include <QtQml/qqmlerror.h>
27#include <QtQml/qqmlabstracturlinterceptor.h>
28#include <QtQml/qqmlprivate.h>
30#include <QtCore/qdatetime.h>
31#include <QtCore/qfileinfo.h>
32#include <QtCore/qurl.h>
40 using Ptr = QQmlRefPointer<QQmlDataBlob>;
66 Status status()
const;
68 bool isLoading()
const;
69 bool isWaiting()
const;
70 bool isComplete()
const;
72 bool isCompleteOrError()
const;
74 qreal progress()
const;
78 QUrl finalUrl()
const;
81 QList<QQmlError> errors()
const;
91 return hasInlineSourceCode || !fileInfo.filePath().isEmpty();
99 bool hasInlineSourceCode =
false;
105 void setError(
const QList<QQmlError> &errors);
114#if QT_CONFIG(qml_network)
119 virtual void allDependenciesDone();
122 virtual void downloadProgressChanged(
qreal);
123 virtual void completed();
134 void cancelAllWaitingFor();
135 void notifyAllWaitingOnMe();
141 StatusMask = 0x0000FFFF,
143 ProgressMask = 0x00FF0000,
145 AsyncMask = 0x80000000,
163 int d = _p.loadRelaxed();
164 int nd = (
d & ~StatusMask) | ((status << StatusShift) & StatusMask);
165 if (
d == nd || _p.testAndSetOrdered(
d, nd))
return;
169 inline bool isAsync()
const
171 return _p.loadRelaxed() & AsyncMask;
174 inline void setIsAsync(
bool v)
177 int d = _p.loadRelaxed();
178 int nd = (
d & ~AsyncMask) | (
v ? AsyncMask : NoMask);
179 if (
d == nd || _p.testAndSetOrdered(
d, nd))
return;
183 inline qreal progress()
const
185 return quint8((_p.loadRelaxed() & ProgressMask) >> ProgressShift) / float(0xFF);
188 inline void setProgress(
qreal progress)
192 int d = _p.loadRelaxed();
193 int nd = (
d & ~ProgressMask) | ((
v << ProgressShift) & ProgressMask);
194 if (
d == nd || _p.testAndSetOrdered(
d, nd))
return;
207 QList<QQmlError> m_errors;
214 mutable QString m_finalUrlString;
222 QVector<QQmlRefPointer<QQmlDataBlob>> m_waitingFor;
224 int m_redirectCount:30;
\inmodule QtCore\reentrant
NetworkError
Indicates all possible error conditions found during the processing of the request.
The QQmlDataBlob encapsulates a data request that can be issued to a QQmlTypeLoader.
virtual void dataReceived(const SourceCodeData &)=0
Invoked when data for the blob is received.
QQmlTypeLoader * typeLoader() const
virtual void initializeFromCachedUnit(const QQmlPrivate::CachedQmlUnit *)=0
QList< QQmlDataBlob * > m_waitingOnMe
QQmlTypeLoader * m_typeLoader
Status
This enum describes the status of the data blob.
The QQmlError class encapsulates a QML error.
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLsizei const GLfloat * v
[13]
static void setError(QJsonObject *response, const QString &msg)
QUrl url("example.com")
[constructor-url-reference]
QNetworkAccessManager manager