QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RFileSystemModel.h
Go to the documentation of this file.
1 #ifndef RFILESYSTEMMODEL_H_
2 #define RFILESYSTEMMODEL_H_
3 
4 #include <QFileSystemModel>
5 
6 #define RDEFAULT_QMODELINDEX QModelIndex()
7 
11 class RFileSystemModel: public QFileSystemModel {
12 
13 Q_OBJECT
14 
15 public:
16  RFileSystemModel(QObject* parent = 0);
17 
18  QModelIndex setRootPath(const QString& newPath);
19  QString rootPath () const;
20  QModelIndex index(const QString& path, int column = 0) const;
21  QModelIndex index(int row, int column, const QModelIndex & parent =
22  RDEFAULT_QMODELINDEX) const;
23  QString filePath(const QModelIndex& index) const;
24  void setFilter(QDir::Filters filters);
25  bool isDir(const QModelIndex& index) const;
26  bool setHeaderData(int section, Qt::Orientation orientation,
27  const QString& value, int role = Qt::EditRole);
28  bool setHeaderData(int section, Qt::Orientation orientation,
29  const QVariant& value, int role = Qt::EditRole);
30  int rowCount(const QModelIndex & parent = RDEFAULT_QMODELINDEX) const;
31  void setIconProvider(QFileIconProvider* provider);
32  void setNameFilter(const QString& filter);
33  void setNameFilters(const QStringList& filters);
34  void setNameFilterDisables(bool enable);
35  bool setItemData(const QModelIndex& index,
36  const QMap<int, QVariant>& roles);
37  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role,
38  const QString& value);
39  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role,
40  const QColor& value);
41  QMap<int, QVariant> itemData(const QModelIndex & index) const;
42  bool canFetchMore(const QModelIndex & parent) const;
43  void fetchMore(const QModelIndex & parent);
44  virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
45  bool removeRow(int row, const QModelIndex & parent = QModelIndex());
46  //virtual Qt::ItemFlags flags(const QModelIndex & index) const;
47 };
48 
50 
51 #endif /* RFILESYSTEMMODEL_H_ */