1// qfilesystemmodel.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 QFileSystemModel : QAbstractItemModel 24{ 25%TypeHeaderCode 26#include <qfilesystemmodel.h> 27%End 28 29public: 30 enum Roles 31 { 32 FileIconRole, 33 FilePathRole, 34 FileNameRole, 35 FilePermissions, 36 }; 37 38 explicit QFileSystemModel(QObject *parent /TransferThis/ = 0); 39 virtual ~QFileSystemModel(); 40 virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 41 QModelIndex index(const QString &path, int column = 0) const; 42 virtual QModelIndex parent(const QModelIndex &child) const; 43 virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; 44 virtual bool canFetchMore(const QModelIndex &parent) const; 45 virtual void fetchMore(const QModelIndex &parent); 46 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 47 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; 48 QVariant myComputer(int role = Qt::ItemDataRole::DisplayRole) const; 49 virtual QVariant data(const QModelIndex &index, int role = Qt::ItemDataRole::DisplayRole) const; 50 virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::ItemDataRole::EditRole); 51 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::ItemDataRole::DisplayRole) const; 52 virtual Qt::ItemFlags flags(const QModelIndex &index) const; 53 virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); 54 virtual QStringList mimeTypes() const; 55 virtual QMimeData *mimeData(const QModelIndexList &indexes) const; 56 virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); 57 virtual Qt::DropActions supportedDropActions() const; 58 QModelIndex setRootPath(const QString &path); 59 QString rootPath() const; 60 QDir rootDirectory() const; 61 void setIconProvider(QFileIconProvider *provider /KeepReference/); 62 QFileIconProvider *iconProvider() const; 63 void setFilter(QDir::Filters filters); 64 QDir::Filters filter() const; 65 void setResolveSymlinks(bool enable); 66 bool resolveSymlinks() const; 67 void setReadOnly(bool enable); 68 bool isReadOnly() const; 69 void setNameFilterDisables(bool enable); 70 bool nameFilterDisables() const; 71 void setNameFilters(const QStringList &filters); 72 QStringList nameFilters() const; 73 QString filePath(const QModelIndex &index) const; 74 bool isDir(const QModelIndex &index) const; 75 qint64 size(const QModelIndex &index) const; 76 QString type(const QModelIndex &index) const; 77 QDateTime lastModified(const QModelIndex &index) const; 78 QModelIndex mkdir(const QModelIndex &parent, const QString &name); 79 QFileDevice::Permissions permissions(const QModelIndex &index) const; 80 bool rmdir(const QModelIndex &index); 81 QString fileName(const QModelIndex &aindex) const; 82 QIcon fileIcon(const QModelIndex &aindex) const; 83 QFileInfo fileInfo(const QModelIndex &aindex) const; 84 bool remove(const QModelIndex &index); 85 86signals: 87 void fileRenamed(const QString &path, const QString &oldName, const QString &newName); 88 void rootPathChanged(const QString &newPath); 89 void directoryLoaded(const QString &path); 90 91protected: 92 virtual bool event(QEvent *event); 93 virtual void timerEvent(QTimerEvent *event); 94 95public: 96%If (Qt_5_7_0 -) 97 virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const; 98%End 99%If (Qt_5_14_0 -) 100 101 enum Option 102 { 103 DontWatchForChanges, 104 DontResolveSymlinks, 105 DontUseCustomDirectoryIcons, 106 }; 107 108%End 109%If (Qt_5_14_0 -) 110 typedef QFlags<QFileSystemModel::Option> Options; 111%End 112%If (Qt_5_14_0 -) 113 void setOption(QFileSystemModel::Option option, bool on = true); 114%End 115%If (Qt_5_14_0 -) 116 bool testOption(QFileSystemModel::Option option) const; 117%End 118%If (Qt_5_14_0 -) 119 void setOptions(QFileSystemModel::Options options); 120%End 121%If (Qt_5_14_0 -) 122 QFileSystemModel::Options options() const; 123%End 124}; 125 126%If (Qt_5_14_0 -) 127QFlags<QFileSystemModel::Option> operator|(QFileSystemModel::Option f1, QFlags<QFileSystemModel::Option> f2); 128%End 129