1// qdirmodel.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QDirModel : QAbstractItemModel 24{ 25%TypeHeaderCode 26#include <qdirmodel.h> 27%End 28 29public: 30 enum Roles 31 { 32 FileIconRole, 33 FilePathRole, 34 FileNameRole, 35 }; 36 37 QDirModel(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort, QObject *parent /TransferThis/ = 0); 38 explicit QDirModel(QObject *parent /TransferThis/ = 0); 39 virtual ~QDirModel(); 40 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 41 virtual QModelIndex parent(const QModelIndex &child) const; 42 QObject *parent() const; 43 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 44 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 45 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 46 virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); 47 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; 48 virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; 49 virtual Qt::ItemFlags flags(const QModelIndex &index) const; 50 virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); 51 virtual QStringList mimeTypes() const; 52 virtual QMimeData *mimeData(const QModelIndexList &indexes) const /TransferBack/; 53 virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); 54 virtual Qt::DropActions supportedDropActions() const; 55 void setIconProvider(QFileIconProvider *provider /KeepReference/); 56 QFileIconProvider *iconProvider() const; 57 void setNameFilters(const QStringList &filters); 58 QStringList nameFilters() const; 59 void setFilter(QDir::Filters filters); 60 QDir::Filters filter() const; 61 void setSorting(QDir::SortFlags sort); 62 QDir::SortFlags sorting() const; 63 void setResolveSymlinks(bool enable); 64 bool resolveSymlinks() const; 65 void setReadOnly(bool enable); 66 bool isReadOnly() const; 67 void setLazyChildCount(bool enable); 68 bool lazyChildCount() const; 69 void refresh(const QModelIndex &parent = QModelIndex()); 70 QModelIndex index(const QString &path, int column = 0) const; 71 bool isDir(const QModelIndex &index) const; 72 QModelIndex mkdir(const QModelIndex &parent, const QString &name); 73 bool rmdir(const QModelIndex &index); 74 bool remove(const QModelIndex &index); 75 QString filePath(const QModelIndex &index) const; 76 QString fileName(const QModelIndex &index) const; 77 QIcon fileIcon(const QModelIndex &index) const; 78 QFileInfo fileInfo(const QModelIndex &index) const; 79}; 80