1// Copyright (C) 2024 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#include "qqmlassetdownloader_p.h"
5#include <QtQml/qqmlcontext.h>
6
7QT_BEGIN_NAMESPACE
8
9using Assets::Downloader::AssetDownloader;
10using Assets::Downloader::AssetDownloaderHelper;
11using Assets::Downloader::QQmlAssetDownloader;
12
13AssetDownloaderHelper::AssetDownloaderHelper(QObject *parent)
14 : AssetDownloader(parent)
15{}
16
17QUrl AssetDownloaderHelper::resolvedUrl(const QUrl &url) const
18{
19 const QQmlContext *context = qmlContext(this);
20 return context ? context->resolvedUrl(url) : url;
21}
22
23AssetDownloaderHelper *QQmlAssetDownloader::create(QQmlEngine *, QJSEngine *)
24{
25 return new AssetDownloaderHelper();
26}
27
28QT_END_NAMESPACE
29

source code of qtdeclarative/src/assets/downloader/qqmlassetdownloader.cpp