QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RFileSystemModel.h
Go to the documentation of this file.
1 
20 #ifndef RFILESYSTEMMODEL_H_
21 #define RFILESYSTEMMODEL_H_
22 
23 #include "gui_global.h"
24 
25 #include <QFileSystemModel>
26 
27 #define RDEFAULT_QMODELINDEX QModelIndex()
28 
33 class QCADGUI_EXPORT RFileSystemModel: public QFileSystemModel {
34 
35 Q_OBJECT
36 
37 public:
38  RFileSystemModel(QObject* parent = 0);
39 
40  QModelIndex setRootPath(const QString& newPath);
41  QString rootPath () const;
42  QModelIndex index(const QString& path, int column = 0) const;
43  QModelIndex index(int row, int column, const QModelIndex & parent =
44  RDEFAULT_QMODELINDEX) const;
45  QString filePath(const QModelIndex& index) const;
46  void setFilter(QDir::Filters filters);
47  bool isDir(const QModelIndex& index) const;
48  bool setHeaderData(int section, Qt::Orientation orientation,
49  const QString& value, int role = Qt::EditRole);
50  bool setHeaderData(int section, Qt::Orientation orientation,
51  const QVariant& value, int role = Qt::EditRole);
52  int rowCount(const QModelIndex & parent = RDEFAULT_QMODELINDEX) const;
53  void setIconProvider(QFileIconProvider* provider);
54  void setNameFilter(const QString& filter);
55  void setNameFilters(const QStringList& filters);
56  void setNameFilterDisables(bool enable);
57  bool setItemData(const QModelIndex& index,
58  const QMap<int, QVariant>& roles);
59  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role,
60  const QString& value);
61  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role,
62  const QColor& value);
63  QMap<int, QVariant> itemData(const QModelIndex & index) const;
64  bool canFetchMore(const QModelIndex & parent) const;
65  void fetchMore(const QModelIndex & parent);
66  virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
67  bool removeRow(int row, const QModelIndex & parent = QModelIndex());
68  //virtual Qt::ItemFlags flags(const QModelIndex & index) const;
69 };
70 
72 
73 #endif /* RFILESYSTEMMODEL_H_ */