QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
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#include <QFileIconProvider>
27
28#define RDEFAULT_QMODELINDEX QModelIndex()
29
34class QCADGUI_EXPORT RFileSystemModel: public QFileSystemModel {
35
36Q_OBJECT
37
38public:
39 RFileSystemModel(QObject* parent = 0);
40
41 QModelIndex setRootPath(const QString& newPath);
42 QString rootPath () const;
43 QModelIndex pathIndex(const QString& path, int column = 0) const;
44 QModelIndex index(int row, int column, const QModelIndex & parent = 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, const QString& value, int role = Qt::EditRole);
49 bool setHeaderData(int section, Qt::Orientation orientation, const QVariant& value, int role = Qt::EditRole);
50 int rowCount(const QModelIndex & parent = RDEFAULT_QMODELINDEX) const;
51 void setIconProvider(QFileIconProvider* provider);
52 void setNameFilter(const QString& filter);
53 void setNameFilters(const QStringList& filters);
54 void setNameFilterDisables(bool enable);
55 bool setItemData(const QModelIndex& index, const QMap<int, QVariant>& roles);
56 bool setItemData(const QModelIndex& index, Qt::ItemDataRole role, const QString& value);
57 bool setItemData(const QModelIndex& index, Qt::ItemDataRole role, const QColor& value);
58 QMap<int, QVariant> itemData(const QModelIndex & index) const;
59 bool canFetchMore(const QModelIndex & parent) const;
60 void fetchMore(const QModelIndex & parent);
61 virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
62 bool removeRow(int row, const QModelIndex & parent = QModelIndex());
63 //virtual Qt::ItemFlags flags(const QModelIndex & index) const;
64};
65
67
68#endif /* RFILESYSTEMMODEL_H_ */
#define RDEFAULT_QMODELINDEX
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RFileSystemModel.h:28
Q_DECLARE_METATYPE(RMath *)
Definition RDebug.h:38
Definition RFileSystemModel.h:34
#define QCADGUI_EXPORT
Definition gui_global.h:10