KIO
KDeviceListModel Class Reference
Device list model in Qt's Interview framework. More...
#include <kdevicelistmodel.h>

Signals | |
void | modelInitialized () |
Public Member Functions | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
QVariant | data (const QModelIndex &index, int role) const |
Solid::Device | deviceForIndex (const QModelIndex &index) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
KDeviceListModel (const Solid::Predicate &predicate, QObject *parent=0) | |
KDeviceListModel (const QString &predicate, QObject *parent=0) | |
KDeviceListModel (QObject *parent=0) | |
QModelIndex | parent (const QModelIndex &child) const |
QModelIndex | rootIndex () const |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
~KDeviceListModel () |
Detailed Description
Device list model in Qt's Interview framework.This class is a tree view model. Each device has a parent excluding the main device(the computer). Only revelant when used with QTreeView.
Definition at line 39 of file kdevicelistmodel.h.
Constructor & Destructor Documentation
KDeviceListModel::KDeviceListModel | ( | QObject * | parent = 0 |
) | [explicit] |
Definition at line 58 of file kdevicelistmodel.cpp.
Definition at line 64 of file kdevicelistmodel.cpp.
KDeviceListModel::KDeviceListModel | ( | const Solid::Predicate & | predicate, | |
QObject * | parent = 0 | |||
) | [explicit] |
Definition at line 70 of file kdevicelistmodel.cpp.
KDeviceListModel::~KDeviceListModel | ( | ) |
Definition at line 76 of file kdevicelistmodel.cpp.
Member Function Documentation
int KDeviceListModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
QVariant KDeviceListModel::data | ( | const QModelIndex & | index, | |
int | role | |||
) | const |
Get a visible data based on Qt role for the given index.
Return the device information for the give index.
- Parameters:
-
index The QModelIndex which contains the row, column to fetch the data. role The Interview data role(ex: Qt::DisplayRole).
- Returns:
- the data for the given index and role.
Definition at line 89 of file kdevicelistmodel.cpp.
Solid::Device KDeviceListModel::deviceForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 175 of file kdevicelistmodel.cpp.
QVariant KDeviceListModel::headerData | ( | int | section, | |
Qt::Orientation | orientation, | |||
int | role = Qt::DisplayRole | |||
) | const |
Get the header data for a given section, orientation and role.
This method return a value to display in header in a view. Only support Qt::Horizontal direction and Qt::DisplayRole role.
- Parameters:
-
section Section of Header to get the data of. orientation Orientation of the header. role The Interview data role(ex: Qt::DisplayRole).
- Returns:
- the header data for the given section.
Definition at line 109 of file kdevicelistmodel.cpp.
QModelIndex KDeviceListModel::index | ( | int | row, | |
int | column, | |||
const QModelIndex & | parent = QModelIndex() | |||
) | const |
Get the children model index for the given row and column.
Definition at line 121 of file kdevicelistmodel.cpp.
void KDeviceListModel::modelInitialized | ( | ) | [signal] |
QModelIndex KDeviceListModel::parent | ( | const QModelIndex & | child | ) | const |
Get the parent QModelIndex for the given model child.
Definition at line 144 of file kdevicelistmodel.cpp.
QModelIndex KDeviceListModel::rootIndex | ( | ) | const |
Definition at line 139 of file kdevicelistmodel.cpp.
int KDeviceListModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() |
) | const |
The documentation for this class was generated from the following files: