QGIS API Documentation  3.2.0-Bonn (bc43194)
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 ()=default
 
virtual int capabilities ()=0
 Returns 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 QVector< QgsDataItem * > createDataItems (const QString &path, QgsDataItem *parentItem)
 Create a vector of instances of QgsDataItem (or null) for given path and parent item. More...
 
virtual bool handlesDirectoryPath (const QString &path)
 Returns true if the provider will handle the directory at the specified path. 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
Since
QGIS 2.10

Definition at line 44 of file qgsdataitemprovider.h.

Constructor & Destructor Documentation

◆ ~QgsDataItemProvider()

virtual QgsDataItemProvider::~QgsDataItemProvider ( )
virtualdefault

Member Function Documentation

◆ capabilities()

virtual int QgsDataItemProvider::capabilities ( )
pure virtual

Returns 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.

◆ createDataItems()

virtual QVector<QgsDataItem *> QgsDataItemProvider::createDataItems ( const QString &  path,
QgsDataItem parentItem 
)
inlinevirtual

Create a vector of instances of QgsDataItem (or null) for given path and parent item.

Caller takes responsibility of deleting created items.

Definition at line 65 of file qgsdataitemprovider.h.

◆ handlesDirectoryPath()

bool QgsDataItemProvider::handlesDirectoryPath ( const QString &  path)
virtual

Returns true if the provider will handle the directory at the specified path.

If the provider indicates that it will handle the directory, the default creation and population of directory items for the path will be avoided and it is left to the provider to correctly populate relevant entries for the path.

The default implementation returns false for all paths.

Since
QGIS 3.0

Reimplemented in QgsDataItemProviderFromPlugin.

Definition at line 20 of file qgsdataitemprovider.cpp.

◆ 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 files: