# class KDeviceListModel

###

Module | kio
Namespace |
Class | KDeviceListModel
Inherits | QAbstractItemModel

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.

Author Michaël Larouche <michael.larouche@kdemail.net>

### methods

- KDeviceListModel (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

- KDeviceListModel (predicate, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  predicate | QString |
  parent | QObject | 0

- KDeviceListModel (predicate, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  predicate | Solid.Predicate |
  parent | QObject | 0

- KDeviceListModel (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject | 0

- KDeviceListModel (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |
  a1 | QObject | 0

- KDeviceListModel (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | Solid.Predicate |
  a1 | QObject | 0

- columnCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()

  Get the number of columns for a model index.

- data (index, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  role | int |

  Get a visible data based on Qt role for the given index. Return the device information for the give index.

  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.

- deviceForIndex (index)

  returns Solid.Device

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |

- headerData (section, orientation, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  section | int |
  orientation | Qt.Orientation |
  role | int | Qt.DisplayRole

  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.

  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.

- index (row, column, parent)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  row | int |
  column | int |
  parent | QModelIndex | QModelIndex()

  Get the children model index for the given row and column.

- modelInitialized ( )

  returns Nothing
  SIGNAL ("modelInitialized ()")

- parent (child)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  child | QModelIndex |

  Get the parent QModelIndex for the given model child.

- rootIndex ( )

  returns QModelIndex

- rowCount (parent)

  returns int

  Argument | Type | Default
  --- | --- | ---
  parent | QModelIndex | QModelIndex()

  Get the number of rows for a model index.