QGIS API Documentation
2.8.2-Wien
|
#include <qgsbrowsermodel.h>
Public Types | |
enum | ItemDataRole { PathRole = Qt::UserRole } |
Public Slots | |
void | addFavouriteDirectory (QString favDir) |
void | beginInsertItems (QgsDataItem *parent, int first, int last) |
void | beginRemoveItems (QgsDataItem *parent, int first, int last) |
void | endInsertItems () |
void | endRemoveItems () |
void | itemDataChanged (QgsDataItem *item) |
void | itemStateChanged (QgsDataItem *item, QgsDataItem::State oldState) |
void | reload () |
void | removeFavourite (const QModelIndex &index) |
void | updateProjectHome () |
Signals | |
void | stateChanged (const QModelIndex &index, QgsDataItem::State oldState) |
Emitted when item children fetch was finished. |
Public Member Functions | |
QgsBrowserModel (QObject *parent=0) | |
~QgsBrowserModel () | |
bool | canFetchMore (const QModelIndex &parent) const override |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
Provides the number of columns of data exposed by the model. | |
void | connectItem (QgsDataItem *item) |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Used to supply item data to views and delegates. | |
QgsDataItem * | dataItem (const QModelIndex &idx) const |
virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Handles the data supplied by a drag and drop operation that ended with the given action. | |
void | fetchMore (const QModelIndex &parent) override |
QModelIndex | findItem (QgsDataItem *item, QgsDataItem *parent=0) const |
QModelIndex | findPath (QString path, Qt::MatchFlag matchFlag=Qt::MatchExactly) |
Return index of item with given path. | |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override |
Used by other components to obtain information about each item provided by the model. | |
bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
Provides views with information to show in their headers. | |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
Returns the index of the item in the model specified by the given row, column and parent index. | |
virtual QMimeData * | mimeData (const QModelIndexList &indexes) const override |
Returns an object that contains serialized items of data corresponding to the list of indexes specified. | |
virtual QStringList | mimeTypes () const override |
Returns a list of mime that can describe model indexes. | |
virtual QModelIndex | parent (const QModelIndex &index) const override |
Returns the parent of the model item with the given index. | |
void | refresh (QString path) |
void | refresh (const QModelIndex &index=QModelIndex()) |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Provides the number of rows of data exposed by the model. |
Static Public Member Functions | |
static QModelIndex | findPath (QAbstractItemModel *model, QString path, Qt::MatchFlag matchFlag=Qt::MatchExactly) |
Protected Member Functions | |
void | addRootItems () |
void | removeRootItems () |
Protected Attributes | |
QgsFavouritesItem * | mFavourites |
QgsDirectoryItem * | mProjectHome |
QVector< QgsDataItem * > | mRootItems |
Definition at line 44 of file qgsbrowsermodel.h.
Definition at line 52 of file qgsbrowsermodel.h.
|
explicit |
Definition at line 47 of file qgsbrowsermodel.cpp.
QgsBrowserModel::~QgsBrowserModel | ( | ) |
Definition at line 57 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 528 of file qgsbrowsermodel.cpp.
|
protected |
Definition at line 89 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 377 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 392 of file qgsbrowsermodel.cpp.
|
override |
Definition at line 488 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Provides the number of columns of data exposed by the model.
List models do not provide this function because it is already implemented in QAbstractListModel.
Definition at line 283 of file qgsbrowsermodel.cpp.
void QgsBrowserModel::connectItem | ( | QgsDataItem * | item | ) |
Definition at line 424 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Used to supply item data to views and delegates.
Generally, models only need to supply data for Qt::DisplayRole and any application-specific user roles, but it is also good practice to provide data for Qt::ToolTipRole, Qt::AccessibleTextRole, and Qt::AccessibleDescriptionRole. See the Qt::ItemDataRole enum documentation for information about the types associated with each role.
Definition at line 212 of file qgsbrowsermodel.cpp.
QgsDataItem * QgsBrowserModel::dataItem | ( | const QModelIndex & | idx | ) | const |
Definition at line 480 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Handles the data supplied by a drag and drop operation that ended with the given action.
Definition at line 465 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 387 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 400 of file qgsbrowsermodel.cpp.
|
override |
Definition at line 496 of file qgsbrowsermodel.cpp.
QModelIndex QgsBrowserModel::findItem | ( | QgsDataItem * | item, |
QgsDataItem * | parent = 0 |
||
) | const |
Definition at line 360 of file qgsbrowsermodel.cpp.
QModelIndex QgsBrowserModel::findPath | ( | QString | path, |
Qt::MatchFlag | matchFlag = Qt::MatchExactly |
||
) |
Return index of item with given path.
It only searches in currently fetched items, i.e. it does not fetch children.
path | item path |
matchFlag | supported is Qt::MatchExactly and Qt::MatchStartsWith which has reverse meaning, i.e. find item with the longest match from start with path (to get as close/deep as possible to deleted item). |
Definition at line 289 of file qgsbrowsermodel.cpp.
|
static |
Definition at line 294 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Used by other components to obtain information about each item provided by the model.
In many models, the combination of flags should include Qt::ItemIsEnabled and Qt::ItemIsSelectable.
Definition at line 195 of file qgsbrowsermodel.cpp.
|
override |
Definition at line 274 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Provides views with information to show in their headers.
The information is only retrieved by views that can display header information.
Definition at line 245 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Returns the index of the item in the model specified by the given row, column and parent index.
Definition at line 343 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 405 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 413 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Returns an object that contains serialized items of data corresponding to the list of indexes specified.
Definition at line 449 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Returns a list of mime that can describe model indexes.
Definition at line 440 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Returns the parent of the model item with the given index.
If the item has no parent, an invalid QModelIndex is returned.
Definition at line 351 of file qgsbrowsermodel.cpp.
void QgsBrowserModel::refresh | ( | QString | path | ) |
Definition at line 510 of file qgsbrowsermodel.cpp.
void QgsBrowserModel::refresh | ( | const QModelIndex & | index = QModelIndex() | ) |
Definition at line 517 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 334 of file qgsbrowsermodel.cpp.
|
slot |
Definition at line 534 of file qgsbrowsermodel.cpp.
|
protected |
Definition at line 184 of file qgsbrowsermodel.cpp.
|
overridevirtual |
Provides the number of rows of data exposed by the model.
Definition at line 256 of file qgsbrowsermodel.cpp.
|
signal |
Emitted when item children fetch was finished.
|
slot |
Definition at line 62 of file qgsbrowsermodel.cpp.
|
protected |
Definition at line 147 of file qgsbrowsermodel.h.
|
protected |
Definition at line 148 of file qgsbrowsermodel.h.
|
protected |
Definition at line 146 of file qgsbrowsermodel.h.