A texture loaded from the network. More...
#include <TextureCache.h>
Public Member Functions | |
| void | refresh () override |
| Refreshes the resource. | |
Public Member Functions inherited from Resource | |
| int | getLRUKey () const |
| Returns the key last used to identify this resource in the unused map. | |
| void | ensureLoading () |
| Makes sure that the resource has started loading. | |
| virtual void | setLoadPriorityOperator (const QPointer< QObject > &owner, std::function< float()> priorityOperator) |
| Sets the load priority for one owner. | |
| float | getLoadPriority () |
| Returns the highest load priority across all owners. | |
| virtual bool | isLoaded () const |
| Checks whether the resource has loaded. | |
| virtual bool | isFailed () const |
| Checks whether the resource has failed to download. | |
| qint64 | getBytesReceived () const |
| For loading resources, returns the number of bytes received. | |
| qint64 | getBytesTotal () const |
| For loading resources, returns the number of total bytes (<= zero if unknown). | |
| qint64 | getBytes () const |
| For loaded resources, returns the number of actual bytes (defaults to total bytes if not explicitly set). | |
| float | getProgress () const |
| For loading resources, returns the load progress. | |
Protected Member Functions | |
| void | makeRequest () override |
| virtual Q_INVOKABLE void | downloadFinished (const QByteArray &data) override |
| bool | handleFailedRequest (ResourceRequest::Result result) override |
| Return true if the resource will be retried. | |
Protected Member Functions inherited from Resource | |
| virtual bool | isCacheable () const |
| Checks whether the resource is cacheable. | |
| void | setSize (const qint64 &bytes) |
| Called when the download is finished and processed, sets the number of actual bytes. | |
| Q_INVOKABLE void | finishedLoading (bool success) |
Additional Inherited Members | |
Signals inherited from Resource | |
| void | loading () |
| Fired when the resource begins downloading. | |
| void | loaded (const QByteArray request) |
| void | finished (bool success) |
| Fired when the resource has finished loading. | |
| void | failed (QNetworkReply::NetworkError error) |
| Fired when the resource failed to load. | |
| void | onRefresh () |
| Fired when the resource is refreshed. | |
| void | onProgress (uint64_t bytesReceived, uint64_t bytesTotal) |
| Fired on progress updates. | |
| void | updateSize (qint64 deltaSize) |
| Fired when the size changes (through setSize). | |
A texture loaded from the network.
|
overrideprotectedvirtual |
Called when the download has finished. This should be overridden by subclasses that need to process the data once it is downloaded.
Reimplemented from Resource.
|
overrideprotectedvirtual |
Called by ResourceCache to begin loading this Resource. This method can be overriden to provide custom request functionality. If this is done, downloadFinished and ResourceCache::requestCompleted must be called.
Reimplemented from Resource.