QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
A model for showing available data sources and other items in a structured tree. More...
#include <qgsbrowserguimodel.h>
Public Member Functions | |
QgsBrowserGuiModel (QObject *parent=nullptr) | |
Constructor for QgsBrowserGuiModel, with the specified parent object. More... | |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
void | setMessageBar (QgsMessageBar *bar) |
Sets message bar that will be passed in QgsDataItemGuiContext to data items. More... | |
Public Member Functions inherited from QgsBrowserModel | |
QgsBrowserModel (QObject *parent=nullptr) | |
Constructor for QgsBrowserModel, with the specified parent object. More... | |
~QgsBrowserModel () override | |
bool | canFetchMore (const QModelIndex &parent) const override |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
Q_DECL_DEPRECATED void | connectItem (QgsDataItem *item) |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QgsDataItem * | dataItem (const QModelIndex &idx) const |
Returns the data item at the specified index, or nullptr if no item exists at the index. More... | |
QMap< QString, QgsDirectoryItem * > | driveItems () const |
Returns a map of the root drive items shown in the browser. More... | |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
void | fetchMore (const QModelIndex &parent) override |
QModelIndex | findItem (QgsDataItem *item, QgsDataItem *parent=nullptr) const |
Returns the model index corresponding to the specified data item. More... | |
QModelIndex | findPath (const QString &path, Qt::MatchFlag matchFlag=Qt::MatchExactly) |
Returns index of item with given path. More... | |
QModelIndex | findUri (const QString &uri, QModelIndex index=QModelIndex()) |
Returns index of layer item with given uri. More... | |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
bool | initialized () const |
Returns true if the model has been initialized. More... | |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
QStringList | mimeTypes () const override |
QModelIndex | parent (const QModelIndex &index) const override |
void | refresh (const QModelIndex &index=QModelIndex()) |
Refresh item children. More... | |
void | refresh (const QString &path) |
Refresh item specified by path. More... | |
QVector< QgsDataItem * > | rootItems () const |
Returns the root items for the model. More... | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
Additional Inherited Members | |
Public Types inherited from QgsBrowserModel | |
enum | ItemDataRole { PathRole = Qt::UserRole , CommentRole = Qt::UserRole + 1 , SortRole , ProviderKeyRole , LayerMetadataRole } |
Public Slots inherited from QgsBrowserModel | |
void | addFavoriteDirectory (const QString &directory, const QString &name=QString()) |
Adds a directory to the favorites group. More... | |
void | beginInsertItems (QgsDataItem *parent, int first, int last) |
void | beginRemoveItems (QgsDataItem *parent, int first, int last) |
void | endInsertItems () |
void | endRemoveItems () |
void | hidePath (QgsDataItem *item) |
Hide the given path in the browser model. More... | |
void | initialize () |
Delayed initialization, needed because the provider registry must be already populated. More... | |
void | itemDataChanged (QgsDataItem *item) |
void | itemStateChanged (QgsDataItem *item, Qgis::BrowserItemState oldState) |
Emitted when an item's state is changed. More... | |
void | refreshDrives () |
Refreshes the list of drive items, removing any corresponding to removed drives and adding newly added drives. More... | |
void | reload () |
Reload the whole model. More... | |
void | removeFavorite (const QModelIndex &index) |
Removes a favorite directory from its corresponding model index. More... | |
void | removeFavorite (QgsFavoriteItem *favorite) |
Removes a favorite item. More... | |
void | updateProjectHome () |
Signals inherited from QgsBrowserModel | |
void | connectionsChanged (const QString &providerKey) |
Emitted when connections for the specified providerKey have changed in the browser. More... | |
void | stateChanged (const QModelIndex &index, Qgis::BrowserItemState oldState) |
Emitted when item children fetch was finished. More... | |
Static Public Member Functions inherited from QgsBrowserModel | |
static QModelIndex | findPath (QAbstractItemModel *model, const QString &path, Qt::MatchFlag matchFlag=Qt::MatchExactly) |
Protected Member Functions inherited from QgsBrowserModel | |
void | addRootItems () |
Populates the model. More... | |
void | removeRootItems () |
Protected Attributes inherited from QgsBrowserModel | |
QgsFavoritesItem * | mFavorites = nullptr |
QgsDirectoryItem * | mProjectHome = nullptr |
QVector< QgsDataItem * > | mRootItems |
A model for showing available data sources and other items in a structured tree.
QgsBrowserGuiModel is the foundation for the QGIS browser panel, and includes items for the different data providers and folders accessible to users.
Definition at line 36 of file qgsbrowserguimodel.h.
|
explicit |
Constructor for QgsBrowserGuiModel, with the specified parent object.
Definition at line 23 of file qgsbrowserguimodel.cpp.
|
override |
Definition at line 107 of file qgsbrowserguimodel.cpp.
|
override |
Definition at line 42 of file qgsbrowserguimodel.cpp.
|
override |
Definition at line 142 of file qgsbrowserguimodel.cpp.
void QgsBrowserGuiModel::setMessageBar | ( | QgsMessageBar * | bar | ) |
Sets message bar that will be passed in QgsDataItemGuiContext to data items.
Definition at line 177 of file qgsbrowserguimodel.cpp.