71 PathRole = Qt::UserRole,
72 CommentRole = Qt::UserRole + 1,
79 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
80 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
81 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
82 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
83 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
84 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
85 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
86 QModelIndex parent(
const QModelIndex &index )
const override;
87 QStringList mimeTypes()
const override;
88 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
89 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
90 bool hasChildren(
const QModelIndex &parent = QModelIndex() )
const override;
91 bool canFetchMore(
const QModelIndex &parent )
const override;
92 void fetchMore(
const QModelIndex &parent )
override;
108 QgsDataItem *dataItem(
const QModelIndex &idx )
const;
111 void refresh(
const QString &path );
114 void refresh(
const QModelIndex &index = QModelIndex() );
124 QModelIndex findPath(
const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
127 static QModelIndex findPath( QAbstractItemModel *model,
const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly )
SIP_SKIP;
138 QModelIndex findUri(
const QString &uri, QModelIndex index = QModelIndex() );
160 QMap<QString, QgsDirectoryItem *> driveItems()
const;
167 QVector<QgsDataItem *>
rootItems()
const {
return mRootItems; }
191 void refreshDrives();
193 void beginInsertItems(
QgsDataItem *parent,
int first,
int last );
194 void endInsertItems();
195 void beginRemoveItems(
QgsDataItem *parent,
int first,
int last );
196 void endRemoveItems();
213 void addFavoriteDirectory(
const QString &directory,
const QString &name = QString() );
220 void removeFavorite(
const QModelIndex &index );
230 void updateProjectHome();
244 void removeRootItems();
253 void onConnectionsChanged(
const QString &providerKey );
256 bool mInitialized =
false;
257 QMap< QString, QgsDirectoryItem * > mDriveItems;
265 friend class TestQgsBrowserModel;
266 friend class TestQgsBrowserProxyModel;