QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsDataItem Class Reference

base class for all items in the model More...

#include <qgsdataitem.h>

Inheritance diagram for QgsDataItem:
Inheritance graph
[legend]
Collaboration diagram for QgsDataItem:
Collaboration graph
[legend]

Public Types

enum  Type {
  Collection, Directory, Layer, Error,
  Favourites
}
enum  Capability { NoCapabilities = 0, SetCrs = 1 }

Public Slots

void emitBeginInsertItems (QgsDataItem *parent, int first, int last)
void emitEndInsertItems ()
void emitBeginRemoveItems (QgsDataItem *parent, int first, int last)
void emitEndRemoveItems ()

Signals

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

Public Member Functions

 QgsDataItem (QgsDataItem::Type type, QgsDataItem *parent, QString name, QString path)
virtual ~QgsDataItem ()
bool hasChildren ()
int rowCount ()
virtual void refresh ()
virtual QVector< QgsDataItem * > createChildren ()
virtual void populate ()
bool isPopulated ()
virtual void addChildItem (QgsDataItem *child, bool refresh=false)
virtual void deleteChildItem (QgsDataItem *child)
virtual QgsDataItemremoveChildItem (QgsDataItem *child)
virtual bool equal (const QgsDataItem *other)
virtual QWidget * paramWidget ()
virtual QList< QAction * > actions ()
virtual bool acceptDrop ()
virtual bool handleDrop (const QMimeData *, Qt::DropAction)
virtual bool setCrs (QgsCoordinateReferenceSystem crs)
virtual Capability capabilities ()
Type type () const
QgsDataItemparent () const
void setParent (QgsDataItem *parent)
QVector< QgsDataItem * > children () const
QIcon icon () const
QString name () const
QString path () const
void setIcon (QIcon icon)
void setToolTip (QString msg)
QString toolTip () const

Static Public Member Functions

static int findItem (QVector< QgsDataItem * > items, QgsDataItem *item)

Protected Attributes

Type mType
QgsDataItemmParent
QVector< QgsDataItem * > mChildren
bool mPopulated
QString mName
QString mPath
QString mToolTip
QIcon mIcon

Detailed Description

base class for all items in the model

Definition at line 41 of file qgsdataitem.h.

Member Enumeration Documentation

Enumerator:
NoCapabilities 
SetCrs 

Definition at line 98 of file qgsdataitem.h.

Enumerator:
Collection 
Directory 
Layer 
Error 
Favourites 

Definition at line 45 of file qgsdataitem.h.

Constructor & Destructor Documentation

QgsDataItem::QgsDataItem ( QgsDataItem::Type  type,
QgsDataItem parent,
QString  name,
QString  path 
)

Definition at line 151 of file qgsdataitem.cpp.

QgsDataItem::~QgsDataItem ( )
virtual

Definition at line 157 of file qgsdataitem.cpp.

References mName, mPath, and QgsDebugMsgLevel.

Member Function Documentation

virtual bool QgsDataItem::acceptDrop ( )
inlinevirtual

Definition at line 91 of file qgsdataitem.h.

Referenced by QgsBrowserModel::flags().

virtual QList<QAction*> QgsDataItem::actions ( )
inlinevirtual

Definition at line 88 of file qgsdataitem.h.

void QgsDataItem::addChildItem ( QgsDataItem child,
bool  refresh = false 
)
virtual
void QgsDataItem::beginInsertItems ( QgsDataItem parent,
int  first,
int  last 
)
signal
void QgsDataItem::beginRemoveItems ( QgsDataItem parent,
int  first,
int  last 
)
signal
virtual Capability QgsDataItem::capabilities ( )
inlinevirtual

Definition at line 108 of file qgsdataitem.h.

Referenced by QgsDirectoryItem::createChildren().

QVector<QgsDataItem*> QgsDataItem::children ( ) const
inline
QVector< QgsDataItem * > QgsDataItem::createChildren ( )
virtual

Reimplemented in QgsZipItem, QgsFavouritesItem, and QgsDirectoryItem.

Definition at line 179 of file qgsdataitem.cpp.

Referenced by populate(), and refresh().

void QgsDataItem::deleteChildItem ( QgsDataItem child)
virtual
void QgsDataItem::emitBeginInsertItems ( QgsDataItem parent,
int  first,
int  last 
)
slot

Definition at line 162 of file qgsdataitem.cpp.

References beginInsertItems().

Referenced by addChildItem(), and removeChildItem().

void QgsDataItem::emitBeginRemoveItems ( QgsDataItem parent,
int  first,
int  last 
)
slot

Definition at line 170 of file qgsdataitem.cpp.

References beginRemoveItems().

Referenced by addChildItem(), and removeChildItem().

void QgsDataItem::emitEndInsertItems ( )
slot

Definition at line 166 of file qgsdataitem.cpp.

References endInsertItems().

Referenced by addChildItem(), and removeChildItem().

void QgsDataItem::emitEndRemoveItems ( )
slot

Definition at line 174 of file qgsdataitem.cpp.

References endRemoveItems().

Referenced by addChildItem(), and removeChildItem().

void QgsDataItem::endInsertItems ( )
signal
void QgsDataItem::endRemoveItems ( )
signal
bool QgsDataItem::equal ( const QgsDataItem other)
virtual

Reimplemented in QgsDirectoryItem, and QgsLayerItem.

Definition at line 334 of file qgsdataitem.cpp.

References mPath, and path().

Referenced by findItem().

int QgsDataItem::findItem ( QVector< QgsDataItem * >  items,
QgsDataItem item 
)
static

Definition at line 287 of file qgsdataitem.cpp.

References equal(), mPath, and QgsDebugMsgLevel.

Referenced by refresh(), and QgsFavouritesItem::removeDirectory().

virtual bool QgsDataItem::handleDrop ( const QMimeData *  ,
Qt::DropAction   
)
inlinevirtual

Definition at line 94 of file qgsdataitem.h.

Referenced by QgsBrowserModel::dropMimeData().

bool QgsDataItem::hasChildren ( )

Definition at line 210 of file qgsdataitem.cpp.

References mChildren, and mPopulated.

Referenced by QgsBrowserModel::hasChildren().

QIcon QgsDataItem::icon ( ) const
inline
bool QgsDataItem::isPopulated ( )
inline

Definition at line 70 of file qgsdataitem.h.

Referenced by QgsBrowserModel::canFetchMore().

QString QgsDataItem::name ( ) const
inline
virtual QWidget* QgsDataItem::paramWidget ( )
inlinevirtual

Reimplemented in QgsDirectoryItem.

Definition at line 85 of file qgsdataitem.h.

QgsDataItem* QgsDataItem::parent ( ) const
inline

Definition at line 118 of file qgsdataitem.h.

Referenced by QgsBrowserModel::parent().

QString QgsDataItem::path ( ) const
inline
void QgsDataItem::populate ( )
virtual
void QgsDataItem::refresh ( )
virtual
QgsDataItem * QgsDataItem::removeChildItem ( QgsDataItem child)
virtual
int QgsDataItem::rowCount ( )

Definition at line 204 of file qgsdataitem.cpp.

References mChildren.

Referenced by QgsZipItem::itemFromPath(), and QgsBrowserModel::rowCount().

virtual bool QgsDataItem::setCrs ( QgsCoordinateReferenceSystem  crs)
inlinevirtual

Definition at line 105 of file qgsdataitem.h.

void QgsDataItem::setIcon ( QIcon  icon)
inline

Definition at line 125 of file qgsdataitem.h.

References icon().

Referenced by QgsBrowserModel::addRootItems().

void QgsDataItem::setParent ( QgsDataItem parent)
inline

Definition at line 119 of file qgsdataitem.h.

Referenced by removeChildItem().

void QgsDataItem::setToolTip ( QString  msg)
inline

Definition at line 127 of file qgsdataitem.h.

QString QgsDataItem::toolTip ( ) const
inline

Definition at line 128 of file qgsdataitem.h.

Referenced by QgsBrowserModel::data().

Type QgsDataItem::type ( ) const
inline

Member Data Documentation

QVector<QgsDataItem*> QgsDataItem::mChildren
protected
QIcon QgsDataItem::mIcon
protected
QString QgsDataItem::mName
protected
QgsDataItem* QgsDataItem::mParent
protected

Definition at line 133 of file qgsdataitem.h.

QString QgsDataItem::mPath
protected
bool QgsDataItem::mPopulated
protected

Definition at line 135 of file qgsdataitem.h.

Referenced by hasChildren(), populate(), and QgsErrorItem::QgsErrorItem().

QString QgsDataItem::mToolTip
protected

Definition at line 138 of file qgsdataitem.h.

Type QgsDataItem::mType
protected

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