QGIS API Documentation
2.6.0-Brighton
|
#include <qgsbrowsermodel.h>
Public Slots | |
void | reload () |
void | beginInsertItems (QgsDataItem *parent, int first, int last) |
void | endInsertItems () |
void | beginRemoveItems (QgsDataItem *parent, int first, int last) |
void | endRemoveItems () |
void | addFavouriteDirectory (QString favDir) |
void | removeFavourite (const QModelIndex &index) |
void | updateProjectHome () |
Public Member Functions | |
QgsBrowserModel (QObject *parent=0) | |
~QgsBrowserModel () | |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
Used by other components to obtain information about each item provided by the model. | |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
Used to supply item data to views and delegates. | |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
Provides views with information to show in their headers. | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Provides the number of rows of data exposed by the model. | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
Provides the number of columns of data exposed by the model. | |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
Returns the index of the item in the model specified by the given row, column and parent index. | |
QModelIndex | findItem (QgsDataItem *item, QgsDataItem *parent=0) const |
virtual QModelIndex | parent (const QModelIndex &index) const |
Returns the parent of the model item with the given index. | |
virtual QStringList | mimeTypes () const |
Returns a list of mime that can describe model indexes. | |
virtual QMimeData * | mimeData (const QModelIndexList &indexes) const |
Returns an object that contains serialized items of data corresponding to the list of indexes specified. | |
virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
Handles the data supplied by a drag and drop operation that ended with the given action. | |
QgsDataItem * | dataItem (const QModelIndex &idx) const |
bool | hasChildren (const QModelIndex &parent=QModelIndex()) const |
void | refresh (QString path) |
void | refresh (const QModelIndex &index=QModelIndex()) |
QModelIndex | findPath (QString path) |
return index of a path | |
void | connectItem (QgsDataItem *item) |
bool | canFetchMore (const QModelIndex &parent) const |
void | fetchMore (const QModelIndex &parent) |
Protected Member Functions | |
void | addRootItems () |
void | removeRootItems () |
Protected Attributes | |
QVector< QgsDataItem * > | mRootItems |
QgsFavouritesItem * | mFavourites |
QgsDirectoryItem * | mProjectHome |
|
explicit |
QgsBrowserModel::~QgsBrowserModel | ( | ) |
|
slot |
|
protected |
|
slot |
|
slot |
bool QgsBrowserModel::canFetchMore | ( | const QModelIndex & | parent | ) | const |
|
virtual |
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.
void QgsBrowserModel::connectItem | ( | QgsDataItem * | item | ) |
|
virtual |
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.
QgsDataItem * QgsBrowserModel::dataItem | ( | const QModelIndex & | idx | ) | const |
|
virtual |
Handles the data supplied by a drag and drop operation that ended with the given action.
|
slot |
|
slot |
void QgsBrowserModel::fetchMore | ( | const QModelIndex & | parent | ) |
QModelIndex QgsBrowserModel::findItem | ( | QgsDataItem * | item, |
QgsDataItem * | parent = 0 |
||
) | const |
QModelIndex QgsBrowserModel::findPath | ( | QString | path | ) |
return index of a path
|
virtual |
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.
bool QgsBrowserModel::hasChildren | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
|
virtual |
Provides views with information to show in their headers.
The information is only retrieved by views that can display header information.
|
virtual |
Returns the index of the item in the model specified by the given row, column and parent index.
|
virtual |
Returns an object that contains serialized items of data corresponding to the list of indexes specified.
|
virtual |
Returns a list of mime that can describe model indexes.
|
virtual |
Returns the parent of the model item with the given index.
If the item has no parent, an invalid QModelIndex is returned.
void QgsBrowserModel::refresh | ( | QString | path | ) |
void QgsBrowserModel::refresh | ( | const QModelIndex & | index = QModelIndex() | ) |
|
slot |
|
slot |
|
protected |
|
virtual |
Provides the number of rows of data exposed by the model.
|
slot |
|
protected |
|
protected |
|
protected |