QDownloadManager ClassThe QDownloadManager class provides asset data download capability. More... #include <QDownloadManager> Inherits: QObject. This class was introduced in Qt 4.8. Public Functions
Signals
Additional Inherited Members
Detailed DescriptionThe QDownloadManager class provides asset data download capability. QDownloadManager encapsulates the functions needed for the downloading of asset data (eg. textures) from a network URL (eg. a website). At the core of QDownloadManager is a QNetworkAccessManager which is shared by all instances of QDownloadManager. The download manager itself provides all handling of network requests and replies internally, and allows for redirection of URLs and handling of errors without the need for the user to query network replies. To use the QDownloadManager simply create an instance of the class within your code, and connect QDownloadManager's downloadComplete() signal to a slot in your own code, then call the downloadAsset() function. For example QDownloadManager dlmanage; connect(this, SLOT(myReceiverSlot(QByteArray*)), &dlmanage, SIGNAL(downloadComplete(QByteArray*))); if (!dlmanage.downloadAsset(QUrl("www.my.image.url.net/image.jpg"))) { dWarning("the manager was unable to send the url request."); } The QDownloadManager will emit the downloadComplete() signal which contains all of the downloaded data in a QByteArray. It is the user's responsibility to convert this data to the format they require, and to verify that it is correct. Member Function Documentation
|