Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlnetworkinformation.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 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// Qt-Security score:significant reason:default
4
6
8
9QNetworkInformation *QQmlNetworkInformation::create(QQmlEngine *, QJSEngine *)
10{
11 static QNetworkInformation *s_singletonInstance = []() {
12 QNetworkInformation::loadDefaultBackend();
13 QNetworkInformation *singletonInstance = QNetworkInformation::instance();
14
15 Q_ASSERT(singletonInstance);
16 QJSEngine::setObjectOwnership(singletonInstance, QJSEngine::CppOwnership);
17 return singletonInstance;
18 }();
19
20 return s_singletonInstance;
21}
22
23QT_END_NAMESPACE
24
25#include "moc_qqmlnetworkinformation_p.cpp"