15 #ifndef QGSBROWSERMODEL_H
16 #define QGSBROWSERMODEL_H
18 #include <QAbstractItemModel>
23 #include <QFutureWatcher>
38 void finished(
QgsDataItem* item, QVector <QgsDataItem*> items );
55 PathRole = Qt::UserRole
61 virtual Qt::ItemFlags flags(
const QModelIndex &
index )
const override;
67 virtual QVariant data(
const QModelIndex &
index,
int role = Qt::DisplayRole )
const override;
71 virtual QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
74 virtual int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
78 virtual int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
81 virtual QModelIndex
index(
int row,
int column,
const QModelIndex & parent = QModelIndex() )
const override;
88 virtual QModelIndex parent(
const QModelIndex &
index )
const override;
91 virtual QStringList mimeTypes()
const override;
94 virtual QMimeData * mimeData(
const QModelIndexList &indexes )
const override;
97 virtual bool dropMimeData(
const QMimeData * data, Qt::DropAction action,
int row,
int column,
const QModelIndex & parent )
override;
99 QgsDataItem *dataItem(
const QModelIndex &idx )
const;
101 bool hasChildren(
const QModelIndex &parent = QModelIndex() )
const override;
104 void refresh( QString path );
107 void refresh(
const QModelIndex &
index = QModelIndex() );
115 QModelIndex findPath( QString path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
116 static QModelIndex findPath( QAbstractItemModel *model, QString path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
120 bool canFetchMore(
const QModelIndex & parent )
const override;
121 void fetchMore(
const QModelIndex & parent )
override;
130 void beginInsertItems(
QgsDataItem *parent,
int first,
int last );
131 void endInsertItems();
132 void beginRemoveItems(
QgsDataItem *parent,
int first,
int last );
133 void endRemoveItems();
137 void addFavouriteDirectory( QString favDir );
138 void removeFavourite(
const QModelIndex &
index );
139 void updateProjectHome();
144 void removeRootItems();
151 #endif // QGSBROWSERMODEL_H