# class ObjectDescriptionModel

###

Module | phonon
Namespace | Phonon
Class | ObjectDescriptionModel
Inherits | QAbstractListModel

### methods

- ObjectDescriptionModel (parent)

  returns ctor

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

  Constructs a ObjectDescription model with the given parent.

- ObjectDescriptionModel (data, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  data | QList<ObjectDescription<type>> |
  parent | QObject | 0

  Constructs a ObjectDescription model with the given parent and the given data.

- data (index, role)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  role | int | Qt.DisplayRole

  Returns data from the item with the given index for the specified role. If the view requests an invalid index, an invalid variant is returned.

  Reimplemented from QAbstractItemModel.

  See also QAbstractItemModel.data

  See also Qt.ItemDataRole

- dropMimeData (data, action, row, column, parent)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  data | QMimeData |
  action | Qt.DropAction |
  row | int |
  column | int |
  parent | QModelIndex |

  Accept drops from other models of the same ObjectDescriptionType.

  If a valid parent is given the dropped items will be inserted above that item.

- flags (index)

  returns Qt.ItemFlags

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

  Reimplemented to show unavailable devices as disabled (but still selectable).

- metaObject ( )

  returns QMetaObject

- mimeData (indexes)

  returns QMimeData

  Argument | Type | Default
  --- | --- | ---
  indexes | QModelIndexList |

  Returns the MIME data that dropMimeData() can use to create new items.

- mimeTypes ( )

  returns QStringList

  Returns a list of supported drag and drop MIME types. Currently it only supports one type used internally.

- modelData ( )

  returns QList<ObjectDescription<type>>

  Returns the model data.

  As the order of the list might have changed this can be different to what was set using setModelData().

- modelData (index)

  returns ObjectDescription<type>

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

  Returns one ObjectDescription of the model data for the given index.

- moveDown (index)

  returns Nothing

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

  Moves the item at the given index down. In the resulting list the items at index.row() and index.row() + 1 are swapped.

  Connected views are updated automatically.

- moveUp (index)

  returns Nothing

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

  Moves the item at the given index up. In the resulting list the items at index.row() and index.row() - 1 are swapped.

  Connected views are updated automatically.

- qt_metacast (_clname)

  returns void

  Argument | Type | Default
  --- | --- | ---
  _clname | char |

  Internal

- removeRows (row, count, parent)

  returns bool

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

  Removes count rows starting with the given row.

  If a valid parent is given no rows are removed since this is a list model.

  Returns true if the rows were successfully removed; otherwise returns false.

- rowCount (parent)

  returns int

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

  Returns the number of rows in the model. This value corresponds to the size of the list passed through setModelData.

  parent - The optional parent argument is used in most models to specify the parent of the rows to be counted. Because this is a list if a valid parent is specified the result will always be 0.

  Reimplemented from QAbstractItemModel.

  See also QAbstractItemModel.rowCount

- setModelData (data)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  data | QList<ObjectDescription<type>> |

  Sets the model data using the list provided by data.

  All previous model data is cleared.

- supportedDropActions ( )

  returns Qt.DropActions

  This model supports drag and drop to copy or move items.

- tupleIndexAtPositionIndex (positionIndex)

  returns int

  Argument | Type | Default
  --- | --- | ---
  positionIndex | int |

  Returns the ObjectDescription.index for the tuple at the given position positionIndex. For example a QComboBox will give you the currentIndex as the position in the list. But to select the according AudioOutputDevice using AudioOutputDevice.fromIndex you can use this method.

  positionIndex - The position in the list.

- tupleIndexOrder ( )

  returns QList<int>

  Returns a list of indexes in the same order as they are in the model. The indexes come from the ObjectDescription.index method.

  This is useful to let the user define a list of preference.

### variables

QMetaObject staticMetaObject | Internal