This commit is contained in:
Nyall Dawson 2019-02-08 19:23:40 +10:00
parent 35ddb3b630
commit 48e05434e4
4 changed files with 49 additions and 6 deletions

View File

@ -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:
@ -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();

View File

@ -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;

View File

@ -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:
@ -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;

View File

@ -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