QNetworkSettingsInterfaceModel Class

The QNetworkSettingsInterfaceModel class represents a network interface model. More...

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

Public Types

enum Roles { Type, Status, Name, Powered }

Public Functions

QNetworkSettingsInterfaceModel(QObject *parent = nullptr)
void append(QNetworkSettingsInterface *item)
QList<QNetworkSettingsInterface *> getModel()
void insert(int row, QNetworkSettingsInterface *item)
void remove(int row)
bool removeInterface(const QString &name)
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 interface model contains a list of network interfaces attached to the host.

Member Type Documentation

enum QNetworkSettingsInterfaceModel::Roles

This enum type holds information about a network interface.

ConstantValueDescription
QNetworkSettingsInterfaceModel::TypeQt::UserRole + 1Network interface type.
QNetworkSettingsInterfaceModel::Status258Network interface state.
QNetworkSettingsInterfaceModel::Name259Network interface name.
QNetworkSettingsInterfaceModel::Powered260Whether the network interface is powered on or off.

Member Function Documentation

[explicit] QNetworkSettingsInterfaceModel::QNetworkSettingsInterfaceModel(QObject *parent = nullptr)

Creates a new network interface model with the parent parent.

void QNetworkSettingsInterfaceModel::append(QNetworkSettingsInterface *item)

Appends item to the model.

[override virtual] QVariant QNetworkSettingsInterfaceModel::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.

QList<QNetworkSettingsInterface *> QNetworkSettingsInterfaceModel::getModel()

Returns the network interface model.

void QNetworkSettingsInterfaceModel::insert(int row, QNetworkSettingsInterface *item)

Inserts item into row in the model.

void QNetworkSettingsInterfaceModel::remove(int row)

Removes the row row from the model.

bool QNetworkSettingsInterfaceModel::removeInterface(const QString &name)

Returns whether the interface with the name was removed successfully.

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

Reimplements: QAbstractItemModel::roleNames() const.

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

[override virtual] int QNetworkSettingsInterfaceModel::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 QNetworkSettingsInterfaceModel::updated(int row)

Notifies that the row has been 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.