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
qnetworkmanagernetworkinformationbackend.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QNETWORKMANAGERINFORMATIONBACKEND_H
5#define QNETWORKMANAGERINFORMATIONBACKEND_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qnetworkinformation_p.h>
20
22
24{
26public:
29
30 QString name() const override;
32 {
33 if (!isValid())
34 return {};
35 return featuresSupportedStatic();
36 }
37
39 {
40 using Feature = QNetworkInformation::Feature;
41 return QNetworkInformation::Features(Feature::Reachability | Feature::CaptivePortal
42 | Feature::TransportMedium | Feature::Metered);
43 }
44
45 bool isValid() const { return iface.isValid(); }
46
47 void onStateChanged(QNetworkManagerInterface::NMState state);
48 void onConnectivityChanged(QNetworkManagerInterface::NMConnectivityState connectivityState);
49 void onDeviceTypeChanged(QNetworkManagerInterface::NMDeviceType deviceType);
51
52private:
54
56};
57
58QT_END_NAMESPACE
59
60#endif
QString name() const override
Backend name, return the same in QNetworkInformationBackend::name().
QNetworkInformationBackend * create(QNetworkInformation::Features requiredFeatures) const override
Create and return an instance of QNetworkInformationBackend.
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackend::featuresSupported().
void onStateChanged(QNetworkManagerInterface::NMState state)
QString name() const override
Backend name, return the same in QNetworkInformationBackendFactory::name().
void onMeteredChanged(QNetworkManagerInterface::NMMetered metered)
void onConnectivityChanged(QNetworkManagerInterface::NMConnectivityState connectivityState)
void onDeviceTypeChanged(QNetworkManagerInterface::NMDeviceType deviceType)
QNetworkInformation::Features featuresSupported() const override
Features supported, return the same in QNetworkInformationBackendFactory::featuresSupported().
Combined button and popup list for selecting options.
static QString backendName()