Skip to content

Commit 42a9679

Browse files
committedMay 18, 2017
Update sip binding
1 parent 7b20c2e commit 42a9679

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed
 

‎python/core/qgsmaplayer.sip

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ class QgsMapLayer : QObject
6767
virtual ~QgsMapLayer();
6868

6969

70+
virtual QgsMapLayer *clone( bool deep ) const = 0;
71+
%Docstring
72+
Returns a new instance equivalent to this one.
73+
\param deep If true, a deep copy is done
74+
:return: a new layer instance
75+
.. versionadded:: 3.0
76+
:rtype: QgsMapLayer
77+
%End
78+
7079
QgsMapLayer::LayerType type() const;
7180
%Docstring
7281
Returns the type of the layer.
@@ -470,6 +479,13 @@ Invoked by QgsProject.read().
470479
:rtype: QVariant
471480
%End
472481

482+
void setCustomProperties( const QgsObjectCustomProperties &properties );
483+
%Docstring
484+
Set custom properties for layer.
485+
\param properties The custom properties to set.
486+
.. versionadded:: 3.0
487+
%End
488+
473489
void removeCustomProperty( const QString &key );
474490
%Docstring
475491
Remove a custom property from layer. Properties are stored in a map and saved in project file.
@@ -1028,6 +1044,16 @@ Signal emitted when the blend mode is changed, through QgsMapLayer.setBlendMode(
10281044
%End
10291045

10301046
protected:
1047+
1048+
void clone( QgsMapLayer *layer, bool deep = false ) const;
1049+
%Docstring
1050+
Copies attributes like name, short name, ... into another layer. The
1051+
unique ID is copied too if deep parameter is true.
1052+
\param layer The copy recipient
1053+
\param deep To copy the unique ID or not
1054+
.. versionadded:: 3.0
1055+
%End
1056+
10311057
virtual void setExtent( const QgsRectangle &rect );
10321058
%Docstring
10331059
Set the extent

‎python/core/qgsmaplayerstylemanager.sip

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ Write configuration (for project saving)
133133
Return list of all defined style names
134134
:rtype: list of str
135135
%End
136+
137+
QMap<QString, QgsMapLayerStyle> mapLayerStyles() const;
138+
%Docstring
139+
Gets available styles for the associated map layer.
140+
:return: A map of map layer style by style name
141+
.. versionadded:: 3.0
142+
:rtype: QMap<str, QgsMapLayerStyle>
143+
%End
144+
136145
QgsMapLayerStyle style( const QString &name ) const;
137146
%Docstring
138147
Return data of a stored style - accessed by its unique name

‎python/core/qgspluginlayer.sip

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ In order to be readable from project files, they should set these attributes in
2626
QgsPluginLayer( const QString &layerType, const QString &layerName = QString() );
2727
~QgsPluginLayer();
2828

29+
virtual QgsPluginLayer *clone( bool deep ) const = 0;
30+
%Docstring
31+
Returns a new instance equivalent to this one.
32+
\param deep If true, a deep copy is done
33+
:return: a new layer instance
34+
.. versionadded:: 3.0
35+
:rtype: QgsPluginLayer
36+
%End
37+
2938
QString pluginLayerType();
3039
%Docstring
3140
Return plugin layer type (the same as used in QgsPluginLayerRegistry)

‎python/core/qgsvectorlayer.sip

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,18 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSin
334334
virtual ~QgsVectorLayer();
335335

336336

337+
virtual QgsVectorLayer *clone( bool deep = false ) const /Factory/;
338+
%Docstring
339+
Returns a new instance equivalent to this one. A new provider is
340+
created for the same data source and renderers for features and diagrams
341+
are cloned too. Moreover, each attributes (transparency, extent, selected
342+
features and so on) are identicals.
343+
\param deep If true, a deep copy is done (unique ID is copied too)
344+
:return: a new layer instance
345+
.. versionadded:: 3.0
346+
:rtype: QgsVectorLayer
347+
%End
348+
337349
QString storageType() const;
338350
%Docstring
339351
Returns the permanent storage type for this layer as a friendly name.

‎python/core/raster/qgsrasterlayer.sip

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ class QgsRasterLayer : QgsMapLayer
4141
/** \brief The destructor */
4242
~QgsRasterLayer();
4343

44+
/** Returns a new instance equivalent to this one. A new provider is
45+
* created for the same data source and renderer is cloned too.
46+
* \param deep If true, a deep copy is done (unique ID is copy too)
47+
* \returns a new layer instance
48+
* \since QGIS 3.0
49+
*/
50+
virtual QgsRasterLayer *clone( bool deep = true ) const /Factory/;
51+
4452
/** \brief This enumerator describes the types of shading that can be used */
4553
enum ColorShadingAlgorithm
4654
{

0 commit comments

Comments
 (0)
Please sign in to comment.