• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KFile

Public Types | Signals | Public Member Functions | List of all members
KFilePlacesModel Class Reference

#include <kfileplacesmodel.h>

Inheritance diagram for KFilePlacesModel:
QAbstractItemModel

Public Types

enum  AdditionalRoles {
  UrlRole = 0x069CD12B, HiddenRole = 0x0741CAAC, SetupNeededRole = 0x059A935D, FixedDeviceRole = 0x332896C1,
  CapacityBarRecommendedRole = 0x1548C5C4
}
 

Signals

void errorMessage (const QString &message)
 
void setupDone (const QModelIndex &index, bool success)
 

Public Member Functions

 KFilePlacesModel (QObject *parent=0)
 
 ~KFilePlacesModel ()
 
void addPlace (const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
 
void addPlace (const QString &text, const KUrl &url, const QString &iconName, const QString &appName, const QModelIndex &after)
 
KBookmark bookmarkForIndex (const QModelIndex &index) const
 
QModelIndex closestItem (const KUrl &url) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant data (const QModelIndex &index, int role) const
 
Solid::Device deviceForIndex (const QModelIndex &index) const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
void editPlace (const QModelIndex &index, const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
 
QAction * ejectActionForIndex (const QModelIndex &index) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
int hiddenCount () const
 
KIcon icon (const QModelIndex &index) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
bool isDevice (const QModelIndex &index) const
 
bool isHidden (const QModelIndex &index) const
 
QMimeData * mimeData (const QModelIndexList &indexes) const
 
QStringList mimeTypes () const
 
QModelIndex parent (const QModelIndex &child) const
 
void removePlace (const QModelIndex &index) const
 
void requestEject (const QModelIndex &index)
 
void requestSetup (const QModelIndex &index)
 
void requestTeardown (const QModelIndex &index)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
void setPlaceHidden (const QModelIndex &index, bool hidden)
 
bool setupNeeded (const QModelIndex &index) const
 
Qt::DropActions supportedDropActions () const
 
QAction * teardownActionForIndex (const QModelIndex &index) const
 
QString text (const QModelIndex &index) const
 
KUrl url (const QModelIndex &index) const
 

Detailed Description

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.

Definition at line 40 of file kfileplacesmodel.h.

Member Enumeration Documentation

◆ AdditionalRoles

enum KFilePlacesModel::AdditionalRoles
Enumerator
UrlRole 
HiddenRole 
SetupNeededRole 
FixedDeviceRole 
CapacityBarRecommendedRole 

Definition at line 44 of file kfileplacesmodel.h.

Constructor & Destructor Documentation

◆ KFilePlacesModel()

KFilePlacesModel::KFilePlacesModel ( QObject *  parent = 0)

Definition at line 90 of file kfileplacesmodel.cpp.

◆ ~KFilePlacesModel()

KFilePlacesModel::~KFilePlacesModel ( )

Member Function Documentation

◆ addPlace() [1/2]

void KFilePlacesModel::addPlace ( const QString &  text,
const KUrl &  url,
const QString &  iconName = QString(),
const QString &  appName = QString() 
)

◆ addPlace() [2/2]

void KFilePlacesModel::addPlace ( const QString &  text,
const KUrl &  url,
const QString &  iconName,
const QString &  appName,
const QModelIndex &  after 
)

◆ bookmarkForIndex()

KBookmark KFilePlacesModel::bookmarkForIndex ( const QModelIndex &  index) const

◆ closestItem()

QModelIndex KFilePlacesModel::closestItem ( const KUrl &  url) const

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

int KFilePlacesModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

Get the number of columns for a model index.

◆ data()

QVariant KFilePlacesModel::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
indexThe QModelIndex which contains the row, column to fetch the data.
roleThe Interview data role(ex: Qt::DisplayRole).
Returns
the data for the given index and role.

◆ deviceForIndex()

Solid::Device KFilePlacesModel::deviceForIndex ( const QModelIndex &  index) const

◆ dropMimeData()

bool KFilePlacesModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)

◆ editPlace()

void KFilePlacesModel::editPlace ( const QModelIndex &  index,
const QString &  text,
const KUrl &  url,
const QString &  iconName = QString(),
const QString &  appName = QString() 
)

◆ ejectActionForIndex()

QAction* KFilePlacesModel::ejectActionForIndex ( const QModelIndex &  index) const

◆ errorMessage

void KFilePlacesModel::errorMessage ( const QString &  message)
signal

◆ flags()

Qt::ItemFlags KFilePlacesModel::flags ( const QModelIndex &  index) const

◆ hiddenCount()

int KFilePlacesModel::hiddenCount ( ) const

◆ icon()

KIcon KFilePlacesModel::icon ( const QModelIndex &  index) const

◆ index()

QModelIndex KFilePlacesModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

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

◆ isDevice()

bool KFilePlacesModel::isDevice ( const QModelIndex &  index) const

◆ isHidden()

bool KFilePlacesModel::isHidden ( const QModelIndex &  index) const

◆ mimeData()

QMimeData* KFilePlacesModel::mimeData ( const QModelIndexList &  indexes) const

◆ mimeTypes()

QStringList KFilePlacesModel::mimeTypes ( ) const

◆ parent()

QModelIndex KFilePlacesModel::parent ( const QModelIndex &  child) const

Get the parent QModelIndex for the given model child.

◆ removePlace()

void KFilePlacesModel::removePlace ( const QModelIndex &  index) const

◆ requestEject()

void KFilePlacesModel::requestEject ( const QModelIndex &  index)

◆ requestSetup()

void KFilePlacesModel::requestSetup ( const QModelIndex &  index)

◆ requestTeardown()

void KFilePlacesModel::requestTeardown ( const QModelIndex &  index)

◆ rowCount()

int KFilePlacesModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

Get the number of rows for a model index.

◆ setPlaceHidden()

void KFilePlacesModel::setPlaceHidden ( const QModelIndex &  index,
bool  hidden 
)

◆ setupDone

void KFilePlacesModel::setupDone ( const QModelIndex &  index,
bool  success 
)
signal

◆ setupNeeded()

bool KFilePlacesModel::setupNeeded ( const QModelIndex &  index) const

◆ supportedDropActions()

Qt::DropActions KFilePlacesModel::supportedDropActions ( ) const

◆ teardownActionForIndex()

QAction* KFilePlacesModel::teardownActionForIndex ( const QModelIndex &  index) const

◆ text()

QString KFilePlacesModel::text ( const QModelIndex &  index) const

◆ url()

KUrl KFilePlacesModel::url ( const QModelIndex &  index) const

The documentation for this class was generated from the following files:
  • kfileplacesmodel.h
  • kfileplacesmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Wed Apr 3 2019 20:31:56 by doxygen 1.8.15 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KFile

Skip menu "KFile"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal