QCAD
Open Source 2D CAD
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 pathIndex(const QString& path, int column = 0) const;
43  QModelIndex index(int row, int column, const QModelIndex & parent = RDEFAULT_QMODELINDEX) const;
44  QString filePath(const QModelIndex& index) const;
45  void setFilter(QDir::Filters filters);
46  bool isDir(const QModelIndex& index) const;
47  bool setHeaderData(int section, Qt::Orientation orientation, const QString& value, int role = Qt::EditRole);
48  bool setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole);
49  int rowCount(const QModelIndex & parent = RDEFAULT_QMODELINDEX) const;
50  void setIconProvider(QFileIconProvider* provider);
51  void setNameFilter(const QString& filter);
52  void setNameFilters(const QStringList& filters);
53  void setNameFilterDisables(bool enable);
54  bool setItemData(const QModelIndex& index, const QMap<int, QVariant>& roles);
55  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role, const QString& value);
56  bool setItemData(const QModelIndex& index, Qt::ItemDataRole role, const QColor& value);
57  QMap<int, QVariant> itemData(const QModelIndex & index) const;
58  bool canFetchMore(const QModelIndex & parent) const;
59  void fetchMore(const QModelIndex & parent);
60  virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
61  bool removeRow(int row, const QModelIndex & parent = QModelIndex());
62  //virtual Qt::ItemFlags flags(const QModelIndex & index) const;
63 };
64 
66 
67 #endif /* RFILESYSTEMMODEL_H_ */
#define RDEFAULT_QMODELINDEX
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RFileSystemModel.h:27
#define QCADGUI_EXPORT
Definition: gui_global.h:10
Q_DECLARE_METATYPE(RMath *)
Definition: RFileSystemModel.h:33