QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsCptCityBrowserModel Class Reference

#include <qgscptcityarchive.h>

Public Types

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

Public Slots

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

Public Member Functions

 QgsCptCityBrowserModel (QObject *parent=0, QgsCptCityArchive *archive=QgsCptCityArchive::defaultArchive(), ViewType Type=Authors)
 ~QgsCptCityBrowserModel ()
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 (QgsCptCityDataItem *item, QgsCptCityDataItem *parent=0) const
virtual QModelIndex parent (const QModelIndex &index) const
 Returns the parent of the model item with the given index.
QgsCptCityDataItemdataItem (const QModelIndex &idx) const
 Returns a list of mime that can describe model indexes.
bool hasChildren (const QModelIndex &parent=QModelIndex()) const
void reload ()
void refresh (QString path)
void refresh (const QModelIndex &index=QModelIndex())
QModelIndex findPath (QString path)
 return index of a path
void connectItem (QgsCptCityDataItem *item)
bool canFetchMore (const QModelIndex &parent) const
void fetchMore (const QModelIndex &parent)

Protected Member Functions

void addRootItems ()
void removeRootItems ()

Protected Attributes

QVector< QgsCptCityDataItem * > mRootItems
QgsCptCityArchivemArchive
ViewType mViewType
QSize mIconSize

Member Enumeration Documentation

Enumerator:
Authors 
Selections 
List 

Constructor & Destructor Documentation

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

Member Function Documentation

void QgsCptCityBrowserModel::addRootItems ( )
protected
void QgsCptCityBrowserModel::beginInsertItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot
void QgsCptCityBrowserModel::beginRemoveItems ( QgsCptCityDataItem parent,
int  first,
int  last 
)
slot
bool QgsCptCityBrowserModel::canFetchMore ( const QModelIndex &  parent) const
int QgsCptCityBrowserModel::columnCount ( const QModelIndex &  parent = QModelIndex()) 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 QgsCptCityBrowserModel::connectItem ( QgsCptCityDataItem item)
QVariant QgsCptCityBrowserModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
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.

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

void QgsCptCityBrowserModel::endInsertItems ( )
slot
void QgsCptCityBrowserModel::endRemoveItems ( )
slot
void QgsCptCityBrowserModel::fetchMore ( const QModelIndex &  parent)
QModelIndex QgsCptCityBrowserModel::findItem ( QgsCptCityDataItem item,
QgsCptCityDataItem parent = 0 
) const
QModelIndex QgsCptCityBrowserModel::findPath ( QString  path)

return index of a path

Qt::ItemFlags QgsCptCityBrowserModel::flags ( const QModelIndex &  index) const
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 QgsCptCityBrowserModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const
QVariant QgsCptCityBrowserModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Provides views with information to show in their headers.

The information is only retrieved by views that can display header information.

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

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

QModelIndex QgsCptCityBrowserModel::parent ( const QModelIndex &  index) const
virtual

Returns the parent of the model item with the given index.

If the item has no parent, an invalid QModelIndex is returned.

void QgsCptCityBrowserModel::refresh ( QString  path)
void QgsCptCityBrowserModel::refresh ( const QModelIndex &  index = QModelIndex())
void QgsCptCityBrowserModel::reload ( )
void QgsCptCityBrowserModel::removeRootItems ( )
protected
int QgsCptCityBrowserModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

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

Member Data Documentation

QgsCptCityArchive* QgsCptCityBrowserModel::mArchive
protected
QSize QgsCptCityBrowserModel::mIconSize
protected
QVector<QgsCptCityDataItem*> QgsCptCityBrowserModel::mRootItems
protected
ViewType QgsCptCityBrowserModel::mViewType
protected

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