Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dox++
  • Loading branch information
nyalldawson committed Feb 8, 2019
1 parent 35ddb3b commit 48e0543
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
19 changes: 17 additions & 2 deletions python/core/auto_generated/qgsdataitem.sip.in
Expand Up @@ -533,8 +533,19 @@ A Collection: logical collection of layers or subcollections, e.g. GRASS locatio

void addChild( QgsDataItem *item /Transfer/ );

static QIcon iconDir(); // shared icon: open/closed directory
static QIcon iconDataCollection(); // default icon for data collection
static QIcon iconDir();
%Docstring
Returns the standard browser directory icon.

.. seealso:: :py:func:`iconDataCollection`
%End

static QIcon iconDataCollection();
%Docstring
Returns the standard browser data collection icon.

.. seealso:: :py:func:`iconDir`
%End

protected:

Expand Down Expand Up @@ -593,6 +604,10 @@ Constructor.


QString dirPath() const;
%Docstring
Returns the full path to the directory the item represents.
%End

virtual bool equal( const QgsDataItem *other );

virtual QIcon icon();
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsmimedatautils.sip.in
Expand Up @@ -67,6 +67,7 @@ Gets mesh layer from uri if possible, otherwise returns None and error is set
QString layerType;

QString providerKey;

QString name;
QString uri;
QStringList supportedCrs;
Expand Down
17 changes: 15 additions & 2 deletions src/core/qgsdataitem.h
Expand Up @@ -556,8 +556,17 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem

void addChild( QgsDataItem *item SIP_TRANSFER ) { mChildren.append( item ); }

static QIcon iconDir(); // shared icon: open/closed directory
static QIcon iconDataCollection(); // default icon for data collection
/**
* Returns the standard browser directory icon.
* \see iconDataCollection()
*/
static QIcon iconDir();

/**
* Returns the standard browser data collection icon.
* \see iconDir()
*/
static QIcon iconDataCollection();

protected:

Expand Down Expand Up @@ -607,7 +616,11 @@ class CORE_EXPORT QgsDirectoryItem : public QgsDataCollectionItem

QVector<QgsDataItem *> createChildren() override;

/**
* Returns the full path to the directory the item represents.
*/
QString dirPath() const { return mDirPath; }

bool equal( const QgsDataItem *other ) override;
QIcon icon() override;
QWidget *paramWidget() override SIP_FACTORY;
Expand Down
18 changes: 16 additions & 2 deletions src/core/qgsmimedatautils.h
Expand Up @@ -72,16 +72,30 @@ class CORE_EXPORT QgsMimeDataUtils
*/
QgsMeshLayer *meshLayer( bool &owner, QString &error ) const;

//! Type of URI. Recognized types: "vector" / "raster" / "mesh" / "plugin" / "custom" / "project"
/**
* Type of URI.
*
* Recognized types include
* - "vector": vector layers
* - "raster": raster layers
* - "mesh": mesh layers
* - "plugin": plugin layers
* - "custom": custom types
* - "project": QGS/QGZ project file
* - "directory": directory path
*
* Mime data from plugins may use additional custom layer types.
*/
QString layerType;

/**
* For "vector" / "raster" type: provider id.
* For "plugin" type: plugin layer type name.
* For "custom" type: key of its QgsCustomDropHandler
* For "project" type: unused
* For "project" and "directory" types: unused
*/
QString providerKey;

//! Human readable name to be used e.g. in layer tree
QString name;
//! Identifier of the data source recognized by its providerKey
Expand Down

0 comments on commit 48e0543

Please sign in to comment.