# class KFilePlacesModel

###

Module | kio
Namespace |
Class | KFilePlacesModel
Inherits | QAbstractItemModel

This class is a list view model. Each entry represents a "place" where user can access files. Only revelant when used with QListView or QTableView.

### enums

- AdditionalRoles { UrlRole, HiddenRole, SetupNeededRole }

enum details

### methods

- KFilePlacesModel (parent)

  returns ctor

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

- addPlace (text, url, iconName, appName)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  url | KUrl |
  iconName | QString | QString()
  appName | QString | QString()

- bookmarkForIndex (index)

  returns KBookmark

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

- closestItem (url)

  returns QModelIndex

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

  Returns the closest item for the URL url. The closest item is defined as item which is equal to the URL or at least is a parent URL. If there are more than one possible parent URL candidates, the item which covers the bigger range of the URL is returned.

  Example: the url is '/home/peter/Documents/Music'. Available items are: - /home/peter - /home/peter/Documents

  The returned item will the one for '/home/peter/Documents'.

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

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

  returns bool

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

- editPlace (index, text, url, iconName, appName)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  text | QString |
  url | KUrl |
  iconName | QString | QString()
  appName | QString | QString()

- errorMessage (message)

  returns Nothing
  SIGNAL ("errorMessage (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  message | QString |

- flags (index)

  returns Qt.ItemFlags

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

- hiddenCount ( )

  returns int

- icon (index)

  returns KIcon

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

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

- isDevice (index)

  returns bool

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

- isHidden (index)

  returns bool

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

- mimeData (indexes)

  returns QMimeData

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

- mimeTypes ( )

  returns QStringList

- parent (child)

  returns QModelIndex

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

  Get the parent QModelIndex for the given model child.

- removePlace (index)

  returns Nothing

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

- requestSetup (index)

  returns Nothing

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

- requestTeardown (index)

  returns Nothing

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

- rowCount (parent)

  returns int

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

  Get the number of rows for a model index.

- setPlaceHidden (index, hidden)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  hidden | bool |

- setupDone (index, success)

  returns Nothing
  SIGNAL ("setupDone (const QModelIndex&, bool)")

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |
  success | bool |

- setupNeeded (index)

  returns bool

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

- supportedDropActions ( )

  returns Qt.DropActions

- teardownActionForIndex (index)

  returns QAction

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

- text (index)

  returns QString

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

- url (index)

  returns KUrl

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

### enums - detail

- AdditionalRoles { UrlRole, HiddenRole, SetupNeededRole }

  | UrlRole | - 0x069CD12B | - |
  | HiddenRole | - 0x0741CAAC | - |
  | SetupNeededRole | - 0x059A935D | - |