Quantum GIS API Documentation  1.8
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Attributes
QgsDataItem Class Reference

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

#include <qgsdataitem.h>

Inheritance diagram for QgsDataItem:
Inheritance graph
Collaboration diagram for QgsDataItem:
Collaboration graph

List of all members.

Public Types

enum  Type {
  Collection, Directory, Layer, Error,
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 ()


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 ()
virtual void addChildItem (QgsDataItem *child, bool refresh=false)
virtual void deleteChildItem (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
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 QPixmap getThemePixmap (const QString theName)
static int findItem (QVector< QgsDataItem * > items, QgsDataItem *item)

Protected Attributes

Type mType
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 40 of file qgsdataitem.h.

Member Enumeration Documentation


Definition at line 92 of file qgsdataitem.h.


Reimplemented in QgsDirectoryItem.

Definition at line 44 of file qgsdataitem.h.

Constructor & Destructor Documentation

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

Definition at line 152 of file qgsdataitem.cpp.

virtual QgsDataItem::~QgsDataItem ( ) [inline, virtual]

Definition at line 54 of file qgsdataitem.h.

Member Function Documentation

virtual bool QgsDataItem::acceptDrop ( ) [inline, virtual]

Definition at line 85 of file qgsdataitem.h.

Referenced by QgsBrowserModel::flags().

virtual QList<QAction*> QgsDataItem::actions ( ) [inline, virtual]

Definition at line 82 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 ( ) [inline, virtual]

Definition at line 102 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 196 of file qgsdataitem.cpp.

References children().

Referenced by populate(), and refresh().

void QgsDataItem::deleteChildItem ( QgsDataItem child) [virtual]

Definition at line 274 of file qgsdataitem.cpp.

References beginRemoveItems(), endRemoveItems(), mChildren, mName, and QgsDebugMsg.

Referenced by refresh().

void QgsDataItem::emitBeginInsertItems ( QgsDataItem parent,
int  first,
int  last 
) [slot]

Definition at line 179 of file qgsdataitem.cpp.

References beginInsertItems().

Referenced by addChildItem().

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

Definition at line 187 of file qgsdataitem.cpp.

References beginRemoveItems().

Referenced by addChildItem().

Definition at line 183 of file qgsdataitem.cpp.

References endInsertItems().

Referenced by addChildItem().

Definition at line 191 of file qgsdataitem.cpp.

References endRemoveItems().

Referenced by addChildItem().

void QgsDataItem::endInsertItems ( ) [signal]

Referenced by addChildItem(), and emitEndInsertItems().

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

Reimplemented in QgsDirectoryItem, and QgsLayerItem.

Definition at line 332 of file qgsdataitem.cpp.

References mPath, and path().

Referenced by findItem().

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

Definition at line 285 of file qgsdataitem.cpp.

References equal(), mPath, and QgsDebugMsg.

Referenced by refresh().

QPixmap QgsDataItem::getThemePixmap ( const QString  theName) [static]
virtual bool QgsDataItem::handleDrop ( const QMimeData *  ,
) [inline, virtual]

Definition at line 88 of file qgsdataitem.h.

Referenced by QgsBrowserModel::dropMimeData().

Definition at line 228 of file qgsdataitem.cpp.

References mChildren, and mPopulated.

Referenced by QgsBrowserModel::hasChildren().

QIcon QgsDataItem::icon ( ) const [inline]
QString QgsDataItem::name ( ) const [inline]
virtual QWidget* QgsDataItem::paramWidget ( ) [inline, virtual]

Reimplemented in QgsDirectoryItem.

Definition at line 79 of file qgsdataitem.h.

QgsDataItem* QgsDataItem::parent ( ) const [inline]

Definition at line 114 of file qgsdataitem.h.

Referenced by QgsBrowserModel::parent().

QString QgsDataItem::path ( ) const [inline]
void QgsDataItem::populate ( ) [virtual]

Definition at line 202 of file qgsdataitem.cpp.

References addChildItem(), children(), createChildren(), mPath, mPopulated, and QgsDebugMsg.

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

void QgsDataItem::refresh ( ) [virtual]

Definition at line 222 of file qgsdataitem.cpp.

References mChildren, mPopulated, and populate().

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

virtual bool QgsDataItem::setCrs ( QgsCoordinateReferenceSystem  crs) [inline, virtual]

Definition at line 99 of file qgsdataitem.h.

void QgsDataItem::setIcon ( QIcon  icon) [inline]

Definition at line 120 of file qgsdataitem.h.

References icon().

Referenced by QgsBrowserModel::addRootItems().

void QgsDataItem::setToolTip ( QString  msg) [inline]

Definition at line 122 of file qgsdataitem.h.

QString QgsDataItem::toolTip ( ) const [inline]

Definition at line 123 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]

Definition at line 131 of file qgsdataitem.h.

Referenced by addChildItem(), deleteChildItem(), and QgsLayerItem::equal().

Definition at line 128 of file qgsdataitem.h.

QString QgsDataItem::mPath [protected]
bool QgsDataItem::mPopulated [protected]

Definition at line 130 of file qgsdataitem.h.

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

QString QgsDataItem::mToolTip [protected]

Definition at line 133 of file qgsdataitem.h.

Type QgsDataItem::mType [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines