QGIS API Documentation  2.9.0-Master
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsCptCityBrowserModel Class Reference

#include <qgscptcityarchive.h>

Inheritance diagram for QgsCptCityBrowserModel:
Inheritance graph
[legend]

Public Types

enum  ViewType { Authors = 0, Selections = 1, List = 2 }
 

Public Slots

void beginInsertItems (QgsCptCityDataItem *parent, int first, int last)
 
void beginRemoveItems (QgsCptCityDataItem *parent, int first, int last)
 
void endInsertItems ()
 
void endRemoveItems ()
 

Public Member Functions

 QgsCptCityBrowserModel (QObject *parent=0, QgsCptCityArchive *archive=QgsCptCityArchive::defaultArchive(), ViewType Type=Authors)
 
 ~QgsCptCityBrowserModel ()
 
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. More...
 
void connectItem (QgsCptCityDataItem *item)
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Used to supply item data to views and delegates. More...
 
QgsCptCityDataItemdataItem (const QModelIndex &idx) const
 Returns a list of mime that can describe model indexes. More...
 
void fetchMore (const QModelIndex &parent) override
 
QModelIndex findItem (QgsCptCityDataItem *item, QgsCptCityDataItem *parent=0) const
 
QModelIndex findPath (QString path)
 return index of a path More...
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 Used by other components to obtain information about each item provided by the model. More...
 
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. More...
 
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. More...
 
virtual QModelIndex parent (const QModelIndex &index) const override
 Returns the parent of the model item with the given index. More...
 
void refresh (QString path)
 
void refresh (const QModelIndex &index=QModelIndex())
 
void reload ()
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Provides the number of rows of data exposed by the model. More...
 

Protected Member Functions

void addRootItems ()
 
void removeRootItems ()
 

Protected Attributes

QgsCptCityArchivemArchive
 
QSize mIconSize
 
QVector< QgsCptCityDataItem * > mRootItems
 
ViewType mViewType
 

Detailed Description

Definition at line 302 of file qgscptcityarchive.h.

Member Enumeration Documentation

Enumerator
Authors 
Selections 
List 

Definition at line 308 of file qgscptcityarchive.h.

Constructor & Destructor Documentation

QgsCptCityBrowserModel::QgsCptCityBrowserModel ( QObject *  parent = 0,
QgsCptCityArchive archive = QgsCptCityArchive::defaultArchive(),
ViewType  Type = Authors 
)

Definition at line 1331 of file qgscptcityarchive.cpp.

QgsCptCityBrowserModel::~QgsCptCityBrowserModel ( )

Definition at line 1342 of file qgscptcityarchive.cpp.

Member Function Documentation

void QgsCptCityBrowserModel::addRootItems ( )
protected

Definition at line 1347 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::beginInsertItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot

Definition at line 1641 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::beginRemoveItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot

Definition at line 1656 of file qgscptcityarchive.cpp.

bool QgsCptCityBrowserModel::canFetchMore ( const QModelIndex &  parent) const
override

Definition at line 1681 of file qgscptcityarchive.cpp.

int QgsCptCityBrowserModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
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 1471 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::connectItem ( QgsCptCityDataItem item)

Definition at line 1669 of file qgscptcityarchive.cpp.

QVariant QgsCptCityBrowserModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
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 1381 of file qgscptcityarchive.cpp.

QgsCptCityDataItem * QgsCptCityBrowserModel::dataItem ( const QModelIndex &  idx) const

Returns a list of mime that can describe model indexes.

Returns an object that contains serialized items of data corresponding to the list of indexes specified Handles the data supplied by a drag and drop operation that ended with the given action

Definition at line 1752 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::endInsertItems ( )
slot

Definition at line 1651 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::endRemoveItems ( )
slot

Definition at line 1664 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::fetchMore ( const QModelIndex &  parent)
override

Definition at line 1699 of file qgscptcityarchive.cpp.

QModelIndex QgsCptCityBrowserModel::findItem ( QgsCptCityDataItem item,
QgsCptCityDataItem parent = 0 
) const

Definition at line 1613 of file qgscptcityarchive.cpp.

QModelIndex QgsCptCityBrowserModel::findPath ( QString  path)

return index of a path

Definition at line 1477 of file qgscptcityarchive.cpp.

Qt::ItemFlags QgsCptCityBrowserModel::flags ( const QModelIndex &  index) const
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 1371 of file qgscptcityarchive.cpp.

bool QgsCptCityBrowserModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 1461 of file qgscptcityarchive.cpp.

QVariant QgsCptCityBrowserModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
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 1431 of file qgscptcityarchive.cpp.

QModelIndex QgsCptCityBrowserModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
overridevirtual

Returns the index of the item in the model specified by the given row, column and parent index.

Definition at line 1596 of file qgscptcityarchive.cpp.

QModelIndex QgsCptCityBrowserModel::parent ( const QModelIndex &  index) const
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 1604 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::refresh ( QString  path)

Definition at line 1585 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::refresh ( const QModelIndex &  index = QModelIndex())

Definition at line 1631 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::reload ( )

Definition at line 1576 of file qgscptcityarchive.cpp.

void QgsCptCityBrowserModel::removeRootItems ( )
protected

Definition at line 1360 of file qgscptcityarchive.cpp.

int QgsCptCityBrowserModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
overridevirtual

Provides the number of rows of data exposed by the model.

Definition at line 1444 of file qgscptcityarchive.cpp.

Member Data Documentation

QgsCptCityArchive* QgsCptCityBrowserModel::mArchive
protected

Definition at line 402 of file qgscptcityarchive.h.

QSize QgsCptCityBrowserModel::mIconSize
protected

Definition at line 404 of file qgscptcityarchive.h.

QVector<QgsCptCityDataItem*> QgsCptCityBrowserModel::mRootItems
protected

Definition at line 401 of file qgscptcityarchive.h.

ViewType QgsCptCityBrowserModel::mViewType
protected

Definition at line 403 of file qgscptcityarchive.h.


The documentation for this class was generated from the following files: