QNetworkSettingsManager Class

The QNetworkSettingsManager class manages network settings. More...

Header: #include <QNetworkSettingsManager>
qmake: QT += networksettings
Inherits: QObject

Properties

  • services : QNetworkSettingsServiceFilter* const
  • userAgent : QNetworkSettingsUserAgent* const
  • 1 property inherited from QObject

Public Functions

QNetworkSettingsManager(QObject *parent = Q_NULLPTR)
void clearConnectionState()
void clearCurrentConnection(QNetworkSettingsService *service)
void connectBySsid(const QString &name, const QString &passphrase)
QNetworkSettingsService *currentWifiConnection()
QNetworkSettingsService *currentWiredConnection()
QNetworkSettingsInterface *interface(int type, int instance)
QNetworkSettingsInterfaceModel *interfaces()
QNetworkSettingsService *service(const QString &name, int type)
QNetworkSettingsServiceFilter *services()
void setCurrentConnection(QNetworkSettingsService *service)
void setUserAgent(QNetworkSettingsUserAgent *agent)
void tryNextConnection()
QNetworkSettingsUserAgent *userAgent()
  • 31 public functions inherited from QObject

Signals

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Protected Variables

QNetworkSettingsManagerPrivate *d_ptr

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QNetworkSettingsManager class manages network settings.

The network manager is designed to be used as a model that contains lists of available network interfaces and services.

A delegate in a view that uses the interface model can access the network interface item with the data model role.

The services list in the model can be controlled with the QNetworkSettingsType::type property, and network service items can be retrieved with the QNetworkSettingsServiceFilter::itemFromRow() method.

See also QNetworkSettingsService.

Property Documentation

currentWifiConnection : QNetworkSettingsService* const

Holds the current Wifi connection.

Access functions:

QNetworkSettingsService *currentWifiConnection()

Notifier signal:

See also QNetworkSettingsService.

currentWiredConnection : QNetworkSettingsService* const

Holds the current wired connection.

Access functions:

QNetworkSettingsService *currentWiredConnection()

Notifier signal:

See also QNetworkSettingsService.

interfaces : QNetworkSettingsInterfaceModel* const

Holds the interface model.

Access functions:

QNetworkSettingsInterfaceModel *interfaces()

Notifier signal:

See also QNetworkSettingsInterfaceModel.

services : QNetworkSettingsServiceFilter* const

Holds the service model.

Access functions:

QNetworkSettingsServiceFilter *services()

Notifier signal:

See also QNetworkSettingsServiceFilter.

userAgent : QNetworkSettingsUserAgent* const

Holds the user credentials for connecting to a network.

Access functions:

QNetworkSettingsUserAgent *userAgent()

See also QNetworkSettingsUserAgent.

Member Function Documentation

QNetworkSettingsManager::QNetworkSettingsManager(QObject *parent = Q_NULLPTR)

Creates a network manager with the parent parent.

void QNetworkSettingsManager::clearConnectionState()

Clears the connection state.

void QNetworkSettingsManager::clearCurrentConnection(QNetworkSettingsService *service)

Terminates the current connection to the specified service.

void QNetworkSettingsManager::connectBySsid(const QString &name, const QString &passphrase)

Creates a connection to the network specified by name using the password passphrase.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QNetworkSettingsService *QNetworkSettingsManager::currentWifiConnection()

Returns the current Wifi connection.

Note: Getter function for property currentWifiConnection.

[signal] void QNetworkSettingsManager::currentWifiConnectionChanged()

This signal is emitted when the current Wifi connection changes.

Note: Notifier signal for property currentWifiConnection.

QNetworkSettingsService *QNetworkSettingsManager::currentWiredConnection()

Returns the current wired connection.

Note: Getter function for property currentWiredConnection.

[signal] void QNetworkSettingsManager::currentWiredConnectionChanged()

This signal is emitted when the current wired connection changes.

Note: Notifier signal for property currentWiredConnection.

QNetworkSettingsInterface *QNetworkSettingsManager::interface(int type, int instance)

Returns the network interface instance instance of the type type.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QNetworkSettingsInterfaceModel *QNetworkSettingsManager::interfaces()

Returns the interface model.

Note: Getter function for property interfaces.

[signal] void QNetworkSettingsManager::interfacesChanged()

This signal is emitted when the network interface changes.

Note: Notifier signal for property interfaces.

QNetworkSettingsService *QNetworkSettingsManager::service(const QString &name, int type)

Returns the service model name of the type type.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QNetworkSettingsServiceFilter *QNetworkSettingsManager::services()

Returns the service model.

QNetworkSettingsType::Types

Note: Getter function for property services.

[signal] void QNetworkSettingsManager::servicesChanged()

This signal is emitted when the network service changes.

Note: Notifier signal for property services.

void QNetworkSettingsManager::setCurrentConnection(QNetworkSettingsService *service)

Creates a connection to the specified service.

void QNetworkSettingsManager::setUserAgent(QNetworkSettingsUserAgent *agent)

Sets the user credentials for connecting to a network to agent.

See also userAgent().

void QNetworkSettingsManager::tryNextConnection()

Attempts to connect using the next network interface in the model.

QNetworkSettingsUserAgent *QNetworkSettingsManager::userAgent()

Returns the user credentials for connecting to a network.

Note: Getter function for property userAgent.

See also setUserAgent().

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.