42 #ifndef QFILESYSTEMMODEL_H 43 #define QFILESYSTEMMODEL_H 45 #include <QtCore/qabstractitemmodel.h> 46 #include <QtCore/qpair.h> 47 #include <QtCore/qdir.h> 48 #include <QtGui/qicon.h> 49 #include <QtCore/qdiriterator.h> 57 #ifndef QT_NO_FILESYSTEMMODEL 59 class ExtendedInformation;
71 void rootPathChanged(
const QString &newPath);
73 void directoryLoaded(
const QString &path);
115 QDir rootDirectory()
const;
120 void setFilter(QDir::Filters
filters);
121 QDir::Filters
filter()
const;
123 void setResolveSymlinks(
bool enable);
124 bool resolveSymlinks()
const;
126 void setReadOnly(
bool enable);
127 bool isReadOnly()
const;
129 void setNameFilterDisables(
bool enable);
130 bool nameFilterDisables()
const;
173 #endif // QT_NO_FILESYSTEMMODEL 179 #endif // QFILESYSTEMMODEL_H The QVariant class acts like a union for the most common Qt data types.
The QDir class provides access to directory structures and their contents.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
The QFileSystemModel class provides a data model for the local filesystem.
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
#define QT_END_NAMESPACE
This macro expands to.
QVariant data(int role=Qt::DisplayRole) const
Returns the data for the given role for the item referred to by the index.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual QStringList mimeTypes() const
Returns a list of MIME types that can be used to describe a list of model indexes.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
virtual Qt::DropActions supportedDropActions() const
Returns the drop actions supported by this model.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
QIcon fileIcon(const QModelIndex &index) const
Returns the icon for the item stored in the model under the given index.
virtual void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Sorts the model by column in the given order.
bool resolveSymlinks
Whether the directory model should resolve symbolic links.
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
bool nameFilterDisables
Whether files that don't pass the name filter are hidden or disabled.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
The QStringList class provides a list of strings.
The QFileIconProvider class provides file icons for the QDirModel and the QFileSystemModel classes...
static const char * data(const QByteArray &arr)
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
virtual bool canFetchMore(const QModelIndex &parent) const
Returns true if there is more data available for parent; otherwise returns false. ...
QFileInfo fileInfo(const QModelIndex &index) const
Returns the QFileInfo for the item stored in the model under the given index.
The QMimeData class provides a container for data that records information about its MIME type...
The QAbstractItemModel class provides the abstract interface for item model classes.
virtual void fetchMore(const QModelIndex &parent)
Fetches any available data for the items with the parent specified by the parent index.
static const char *const filters[3]
The QDateTime class provides date and time functions.
The QTimerEvent class contains parameters that describe a timer event.
QObject * parent() const
Returns a pointer to the parent object.
The QModelIndex class is used to locate data in a data model.
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
T qvariant_cast(const QVariant &)
#define Q_DECLARE_PRIVATE(Class)
bool readOnly
Whether the directory model allows writing to the file system.
The QFileInfo class provides system-independent file information.
The QEvent class is the base class of all event classes.
static QString fileName(const QString &fileUrl)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Reimplemented Function
The QIcon class provides scalable icons in different modes and states.