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 = Q_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
virtual QHash<int, QByteArray> roleNames() const
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Additional Inherited Members

Detailed Description

The QNetworkSettingsServiceModel class represents a network service.

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.

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 = Q_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.

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

Reimplemented from QAbstractItemModel::data().

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.

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

Reimplemented from QAbstractItemModel::roleNames().

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

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

Reimplemented from QAbstractItemModel::rowCount().

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.

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