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 | |
4 | #include "qqmlnetworkinformation_p.h" |
5 | |
6 | QT_BEGIN_NAMESPACE |
7 | |
8 | QNetworkInformation *QQmlNetworkInformation::create(QQmlEngine *, QJSEngine *) |
9 | { |
10 | static QNetworkInformation *s_singletonInstance = []() { |
11 | QNetworkInformation::loadDefaultBackend(); |
12 | QNetworkInformation *singletonInstance = QNetworkInformation::instance(); |
13 | |
14 | Q_ASSERT(singletonInstance); |
15 | QJSEngine::setObjectOwnership(singletonInstance, QJSEngine::CppOwnership); |
16 | return singletonInstance; |
17 | }(); |
18 | |
19 | return s_singletonInstance; |
20 | } |
21 | |
22 | QT_END_NAMESPACE |
23 | |
24 | #include "moc_qqmlnetworkinformation_p.cpp" |
25 |
Definitions
Learn Advanced QML with KDAB
Find out more