QFileSystemModel Class Reference

#include <qfilesystemmodel.h>

Class Description

Definition at line 63 of file qfilesystemmodel.h.

+ Inheritance diagram for QFileSystemModel:

Public Types

enum  Roles { FileIconRole = Qt::DecorationRole, FilePathRole = Qt::UserRole + 1, FileNameRole = Qt::UserRole + 2, FilePermissions = Qt::UserRole + 3 }
 

Signals

void rootPathChanged (const QString &newPath)
 
void fileRenamed (const QString &path, const QString &oldName, const QString &newName)
 
void directoryLoaded (const QString &path)
 
- Signals inherited from QAbstractItemModel
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
void layoutChanged ()
 
void layoutAboutToBeChanged ()
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 

Public Member Functions

 QFileSystemModel (QObject *parent=0)
 
 ~QFileSystemModel ()
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
QModelIndex index (const QString &path, int column=0) const
 
QModelIndex parent (const QModelIndex &child) const
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const
 
bool canFetchMore (const QModelIndex &parent) const
 
void fetchMore (const QModelIndex &parent)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant myComputer (int role=Qt::DisplayRole) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
 
QStringList mimeTypes () const
 
QMimeDatamimeData (const QModelIndexList &indexes) const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
Qt::DropActions supportedDropActions () const
 
QModelIndex setRootPath (const QString &path)
 
QString rootPath () const
 
QDir rootDirectory () const
 
void setIconProvider (QFileIconProvider *provider)
 
QFileIconProvidericonProvider () const
 
void setFilter (QDir::Filters filters)
 
QDir::Filters filter () const
 
void setResolveSymlinks (bool enable)
 
bool resolveSymlinks () const
 
void setReadOnly (bool enable)
 
bool isReadOnly () const
 
void setNameFilterDisables (bool enable)
 
bool nameFilterDisables () const
 
void setNameFilters (const QStringList &filters)
 
QStringList nameFilters () const
 
QString filePath (const QModelIndex &index) const
 
bool isDir (const QModelIndex &index) const
 
qint64 size (const QModelIndex &index) const
 
QString type (const QModelIndex &index) const
 
QDateTime lastModified (const QModelIndex &index) const
 
QModelIndex mkdir (const QModelIndex &parent, const QString &name)
 
bool rmdir (const QModelIndex &index) const
 
QString fileName (const QModelIndex &index) const
 
QIcon fileIcon (const QModelIndex &index) const
 
QFile::Permissions permissions (const QModelIndex &index) const
 
QFileInfo fileInfo (const QModelIndex &index) const
 
bool remove (const QModelIndex &index) const
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent=0)
 
virtual ~QAbstractItemModel ()
 
bool hasIndex (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
QModelIndex sibling (int row, int column, const QModelIndex &idx) const
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
Qt::DropActions supportedDragActions () const
 
void setSupportedDragActions (Qt::DropActions)
 
virtual bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 
virtual bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 
bool insertRow (int row, const QModelIndex &parent=QModelIndex())
 
bool insertColumn (int column, const QModelIndex &parent=QModelIndex())
 
bool removeRow (int row, const QModelIndex &parent=QModelIndex())
 
bool removeColumn (int column, const QModelIndex &parent=QModelIndex())
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
 
virtual QSize span (const QModelIndex &index) const
 
const QHash< int, QByteArray > & roleNames () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=0)
 
virtual ~QObject ()
 
virtual bool eventFilter (QObject *, QEvent *)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool b)
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval)
 
void killTimer (int id)
 
template<typename T >
findChild (const QString &aName=QString()) const
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
const QObjectListchildren () const
 
void setParent (QObject *)
 
void installEventFilter (QObject *)
 
void removeEventFilter (QObject *)
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void setUserData (uint id, QObjectUserData *data)
 
QObjectUserDatauserData (uint id) const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Protected Member Functions

 QFileSystemModel (QFileSystemModelPrivate &, QObject *parent=0)
 
void timerEvent (QTimerEvent *event)
 
bool event (QEvent *event)
 
- Protected Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QAbstractItemModelPrivate &dd, QObject *parent=0)
 
QModelIndex createIndex (int row, int column, void *data=0) const
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
void encodeData (const QModelIndexList &indexes, QDataStream &stream) const
 
bool decodeData (int row, int column, const QModelIndex &parent, QDataStream &stream)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
void endInsertRows ()
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void endRemoveRows ()
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
 
void endMoveRows ()
 
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void endInsertColumns ()
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void endRemoveColumns ()
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
 
void endMoveColumns ()
 
void reset ()
 
void beginResetModel ()
 
void endResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndexList persistentIndexList () const
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
virtual void childEvent (QChildEvent *)
 
virtual void customEvent (QEvent *)
 
virtual void connectNotify (const char *signal)
 
virtual void disconnectNotify (const char *signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 

Properties

bool resolveSymlinks
 
bool readOnly
 
bool nameFilterDisables
 
- Properties inherited from QObject
QString objectName
 

Additional Inherited Members

- Public Slots inherited from QAbstractItemModel
virtual bool submit ()
 
virtual void revert ()
 
- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Member Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
- Protected Slots inherited from QAbstractItemModel
void resetInternalData ()
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Attributes inherited from QObject
static const QMetaObject staticQtMetaObject
 

Member Enumeration Documentation

Constructor & Destructor Documentation

QFileSystemModel ( QObject parent = 0)
explicit
QFileSystemModel ( QFileSystemModelPrivate &  ,
QObject parent = 0 
)
protected

Member Function Documentation

void rootPathChanged ( const QString newPath)
signal
void fileRenamed ( const QString path,
const QString oldName,
const QString newName 
)
signal
void directoryLoaded ( const QString path)
signal
QModelIndex index ( int  row,
int  column,
const QModelIndex parent = QModelIndex() 
) const
virtual

Implements QAbstractItemModel.

QModelIndex index ( const QString path,
int  column = 0 
) const
QModelIndex parent ( const QModelIndex child) const
virtual

Implements QAbstractItemModel.

bool hasChildren ( const QModelIndex parent = QModelIndex()) const
virtual

Reimplemented from QAbstractItemModel.

bool canFetchMore ( const QModelIndex parent) const
virtual

Reimplemented from QAbstractItemModel.

void fetchMore ( const QModelIndex parent)
virtual

Reimplemented from QAbstractItemModel.

int rowCount ( const QModelIndex parent = QModelIndex()) const
virtual

Implements QAbstractItemModel.

int columnCount ( const QModelIndex parent = QModelIndex()) const
virtual

Implements QAbstractItemModel.

QVariant myComputer ( int  role = Qt::DisplayRole) const
QVariant data ( const QModelIndex index,
int  role = Qt::DisplayRole 
) const
virtual

Implements QAbstractItemModel.

bool setData ( const QModelIndex index,
const QVariant value,
int  role = Qt::EditRole 
)
virtual

Reimplemented from QAbstractItemModel.

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented from QAbstractItemModel.

Qt::ItemFlags flags ( const QModelIndex index) const
virtual

Reimplemented from QAbstractItemModel.

void sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
virtual

Reimplemented from QAbstractItemModel.

QStringList mimeTypes ( ) const
virtual

Reimplemented from QAbstractItemModel.

QMimeData* mimeData ( const QModelIndexList indexes) const
virtual

Reimplemented from QAbstractItemModel.

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

Reimplemented from QAbstractItemModel.

Qt::DropActions supportedDropActions ( ) const
virtual

Reimplemented from QAbstractItemModel.

QModelIndex setRootPath ( const QString path)
QString rootPath ( ) const
QDir rootDirectory ( ) const
void setIconProvider ( QFileIconProvider provider)
QFileIconProvider* iconProvider ( ) const
void setFilter ( QDir::Filters  filters)
QDir::Filters filter ( ) const
void setResolveSymlinks ( bool  enable)
bool resolveSymlinks ( ) const
void setReadOnly ( bool  enable)
bool isReadOnly ( ) const
void setNameFilterDisables ( bool  enable)
bool nameFilterDisables ( ) const
void setNameFilters ( const QStringList filters)
QStringList nameFilters ( ) const
QString filePath ( const QModelIndex index) const
bool isDir ( const QModelIndex index) const
qint64 size ( const QModelIndex index) const
QString type ( const QModelIndex index) const
QDateTime lastModified ( const QModelIndex index) const
QModelIndex mkdir ( const QModelIndex parent,
const QString name 
)
bool rmdir ( const QModelIndex index) const
QString fileName ( const QModelIndex index) const
inline

Definition at line 166 of file qfilesystemmodel.h.

167 { return aindex.data(Qt::DisplayRole).toString(); }
QIcon fileIcon ( const QModelIndex index) const
inline

Definition at line 168 of file qfilesystemmodel.h.

169 { return qvariant_cast<QIcon>(aindex.data(Qt::DecorationRole)); }
Definition: qicon.h:60
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
QFile::Permissions permissions ( const QModelIndex index) const
QFileInfo fileInfo ( const QModelIndex index) const
inline

Definition at line 170 of file qfilesystemmodel.h.

171 { return QFileInfo(filePath(aindex)); }
QString filePath(const QModelIndex &index) const
bool remove ( const QModelIndex index) const
void timerEvent ( QTimerEvent event)
protectedvirtual

Reimplemented from QObject.

bool event ( QEvent event)
protectedvirtual

Reimplemented from QObject.

Property Documentation

bool resolveSymlinks
readwrite

Definition at line 66 of file qfilesystemmodel.h.

bool readOnly
readwrite

Definition at line 67 of file qfilesystemmodel.h.

bool nameFilterDisables
readwrite

Definition at line 68 of file qfilesystemmodel.h.


The documentation for this class was generated from the following file: