45 #include <QtCore/qabstractitemmodel.h> 46 #include <QtCore/qdir.h> 47 #include <QtGui/qfileiconprovider.h> 55 #ifndef QT_NO_DIRMODEL 108 void setFilter(QDir::Filters
filters);
109 QDir::Filters
filter()
const;
111 void setSorting(QDir::SortFlags
sort);
112 QDir::SortFlags sorting()
const;
114 void setResolveSymlinks(
bool enable);
115 bool resolveSymlinks()
const;
117 void setReadOnly(
bool enable);
118 bool isReadOnly()
const;
120 void setLazyChildCount(
bool enable);
121 bool lazyChildCount()
const;
135 #ifdef Q_NO_USING_KEYWORD 154 #endif // QT_NO_DIRMODEL 160 #endif // QDIRMODEL_H The QVariant class acts like a union for the most common Qt data types.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
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.
bool resolveSymlinks
Whether the directory model should resolve symbolic links.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
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.
bool readOnly
Whether the directory model allows writing to the file system.
The QObject class is the base class of all Qt objects.
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.
virtual void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Sorts the model by column in the given order.
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...
#define QT_BEGIN_NAMESPACE
This macro expands to.
static void sort(T *array, int count, LessThan lessThan)
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.
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.
bool lazyChildCount
Whether the directory model optimizes the hasChildren function to only check if the item is a directo...
static const char *const filters[3]
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)
#define Q_DECLARE_PRIVATE(Class)
The QFileInfo class provides system-independent file information.
static QString fileName(const QString &fileUrl)
The QDirModel class provides a data model for the local filesystem.
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
The QIcon class provides scalable icons in different modes and states.