QNetworkSettingsServiceModel Class

The QNetworkSettingsServiceModel class represents a network service. More...

Header: #include <QNetworkSettingsServiceModel>
qmake: QT += networksettings
Inherits: QAbstractListModel

Public Types

enum Roles { Type, Name, SignalStrength, Connected }

Public Functions

QNetworkSettingsServiceModel(QObject *parent = nullptr)
virtual ~QNetworkSettingsServiceModel()
void append(QNetworkSettingsService *item)
QNetworkSettingsService *getByName(const QString &name)
QList<QNetworkSettingsService *> getModel()
void insert(int row, QNetworkSettingsService *item)
void remove(int row)
bool removeService(const QString &id)
bool replacePlaceholder(QNetworkSettingsService *item)
void updated(int row)

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
virtual QHash<int, QByteArray> roleNames() const override
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override

Detailed Description

The network service model contains a list of network services provided by the host.

See also QNetworkSettingsService.

Member Type Documentation

enum QNetworkSettingsServiceModel::Roles

This enum type holds information about the network connection.

ConstantValueDescription
QNetworkSettingsServiceModel::TypeQt::UserRole + 1Network type.
QNetworkSettingsServiceModel::Name258The service set identifier (SSID) of the network.
QNetworkSettingsServiceModel::SignalStrength259The signal strength of the connection.
QNetworkSettingsServiceModel::Connected260Whether the connection has been established.

Member Function Documentation

QNetworkSettingsServiceModel::QNetworkSettingsServiceModel(QObject *parent = nullptr)

Creates a network service model with the parent parent.

[virtual] QNetworkSettingsServiceModel::~QNetworkSettingsServiceModel()

Deletes the network service model.

void QNetworkSettingsServiceModel::append(QNetworkSettingsService *item)

Appends item to the model.

[override virtual] QVariant QNetworkSettingsServiceModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.

Returns the data at the index index in the model for the type of data specified by role.

QNetworkSettingsService *QNetworkSettingsServiceModel::getByName(const QString &name)

Returns the service with the name name.

QList<QNetworkSettingsService *> QNetworkSettingsServiceModel::getModel()

Returns the network service model.

void QNetworkSettingsServiceModel::insert(int row, QNetworkSettingsService *item)

Inserts item into row in the model.

void QNetworkSettingsServiceModel::remove(int row)

Removes the row row from the model.

bool QNetworkSettingsServiceModel::removeService(const QString &id)

Removes the service specified by id from the model. Returns true if the service was successfully removed, false otherwise.

bool QNetworkSettingsServiceModel::replacePlaceholder(QNetworkSettingsService *item)

Replaces placeholder data with item. Returns true on success.

[override virtual] QHash<int, QByteArray> QNetworkSettingsServiceModel::roleNames() const

Reimplements: QAbstractItemModel::roleNames() const.

Returns an array of the names of the roles in the model.

[override virtual] int QNetworkSettingsServiceModel::rowCount(const QModelIndex &parent = QModelIndex()) const

Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.

Returns the number of rows in the model with the parent parent.

void QNetworkSettingsServiceModel::updated(int row)

Marks the data on the row row in the model as updated.

© 2024 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.