QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | List of all members
QgsDataItemProvider Class Referenceabstract

This is the interface for those who want to add custom data items to the browser tree. More...

#include <qgsdataitemprovider.h>

Inheritance diagram for QgsDataItemProvider:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsDataItemProvider ()
 
virtual int capabilities ()=0
 Return combination of flags from QgsDataProvider::DataCapabilities. More...
 
virtual QgsDataItemcreateDataItem (const QString &path, QgsDataItem *parentItem)=0
 Create a new instance of QgsDataItem (or null) for given path and parent item. More...
 
virtual QString name ()=0
 Human-readable name of the provider name. More...
 

Detailed Description

This is the interface for those who want to add custom data items to the browser tree.

The method createDataItem() is ever called only if capabilities() return non-zero value. There are two occasions when createDataItem() is called:

  1. to create root items (passed path is empty, parent item is null).
  2. to create items in directory structure. For this capabilities have to return at least of the following: QgsDataProider::Dir or QgsDataProvider::File. Passed path is the file or directory being inspected, parent item is a valid QgsDirectoryItem
Note
added in 2.10

Definition at line 35 of file qgsdataitemprovider.h.

Constructor & Destructor Documentation

◆ ~QgsDataItemProvider()

virtual QgsDataItemProvider::~QgsDataItemProvider ( )
inlinevirtual

Definition at line 38 of file qgsdataitemprovider.h.

Member Function Documentation

◆ capabilities()

virtual int QgsDataItemProvider::capabilities ( )
pure virtual

Return combination of flags from QgsDataProvider::DataCapabilities.

Implemented in QgsDataItemProviderFromPlugin.

◆ createDataItem()

virtual QgsDataItem* QgsDataItemProvider::createDataItem ( const QString path,
QgsDataItem parentItem 
)
pure virtual

Create a new instance of QgsDataItem (or null) for given path and parent item.

Caller takes responsibility of deleting created items.

Implemented in QgsDataItemProviderFromPlugin.

◆ name()

virtual QString QgsDataItemProvider::name ( )
pure virtual

Human-readable name of the provider name.

Implemented in QgsDataItemProviderFromPlugin.


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