Skip to content

Commit 15f3bbf

Browse files
committedJul 24, 2017
Add some missing /Factory/ annotations
1 parent 43d094e commit 15f3bbf

File tree

6 files changed

+30
-30
lines changed

6 files changed

+30
-30
lines changed
 

‎python/core/qgscolorramp.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class QgsGradientColorRamp : QgsColorRamp
144144
\param stops optional list of additional color stops
145145
%End
146146

147-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
147+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
148148
%Docstring
149149
Creates a new QgsColorRamp from a map of properties
150150
:rtype: QgsColorRamp
@@ -477,7 +477,7 @@ class QgsPresetSchemeColorRamp : QgsColorRamp, QgsColorScheme
477477
not available in Python bindings - use setColors instead
478478
%End
479479

480-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
480+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
481481
%Docstring
482482
Returns a new QgsPresetSchemeColorRamp color ramp created using the properties encoded in a string
483483
map.
@@ -541,7 +541,7 @@ class QgsColorBrewerColorRamp : QgsColorRamp
541541
\param inverted invert ramp ordering
542542
%End
543543

544-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
544+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
545545
%Docstring
546546
Returns a new QgsColorBrewerColorRamp color ramp created using the properties encoded in a string
547547
map.
@@ -647,7 +647,7 @@ class QgsCptCityColorRamp : QgsGradientColorRamp
647647
\param doLoadFile load cpt-city ramp from file
648648
%End
649649

650-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
650+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
651651
%Docstring
652652
:rtype: QgsColorRamp
653653
%End

‎python/core/symbology-ng/qgssymbollayerregistry.sip

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Create a symbol layer of this type given the map of properties.
5252
Create widget for symbol layer of this type. Can return NULL if there's no GUI
5353
:rtype: QgsSymbolLayerWidget
5454
%End
55-
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & );
55+
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) /Factory/;
5656
%Docstring
5757
Create a symbol layer of this type given the map of properties.
5858
:rtype: QgsSymbolLayer
@@ -85,9 +85,9 @@ Convenience metadata class that uses static functions to create symbol layer and
8585

8686

8787

88-
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map );
89-
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl );
90-
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem );
88+
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) /Factory/;
89+
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) /Factory/;
90+
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) /Factory/;
9191
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
9292

9393
protected:
@@ -133,7 +133,7 @@ create a new instance of symbol layer given symbol layer name and properties
133133
:rtype: QgsSymbolLayer
134134
%End
135135

136-
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
136+
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const /Factory/;
137137
%Docstring
138138
create a new instance of symbol layer given symbol layer name and SLD
139139
:rtype: QgsSymbolLayer

‎python/core/symbology-ng/qgssymbollayerutils.sip

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,15 @@ Writes a symbol definition to XML
337337
:rtype: bool
338338
%End
339339

340-
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
340+
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) /Factory/;
341341
%Docstring
342342
:rtype: QgsSymbolLayer
343343
%End
344-
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
344+
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) /Factory/;
345345
%Docstring
346346
:rtype: QgsSymbolLayer
347347
%End
348-
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
348+
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) /Factory/;
349349
%Docstring
350350
:rtype: QgsSymbolLayer
351351
%End
@@ -577,7 +577,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
577577
:rtype: QVariant
578578
%End
579579

580-
static QgsColorRamp *loadColorRamp( const QVariant &value );
580+
static QgsColorRamp *loadColorRamp( const QVariant &value ) /Factory/;
581581
%Docstring
582582
Load a color ramp from a QVariantMap, wrapped in a QVariant.
583583
You can use QgsXmlUtils.readVariant to load it from an XML document.
@@ -605,7 +605,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
605605
:rtype: list of QColor
606606
%End
607607

608-
static QMimeData *colorToMimeData( const QColor &color );
608+
static QMimeData *colorToMimeData( const QColor &color ) /Factory/;
609609
%Docstring
610610
Creates mime data from a color. Sets both the mime data's color data, and the
611611
mime data's text with the color's hex code.
@@ -636,7 +636,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
636636
:rtype: QgsNamedColorList
637637
%End
638638

639-
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true );
639+
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) /Factory/;
640640
%Docstring
641641
Creates mime data from a list of named colors
642642
\param colorList list of named colors

‎src/core/qgscolorramp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class CORE_EXPORT QgsGradientColorRamp : public QgsColorRamp
142142
const QgsGradientStopsList &stops = QgsGradientStopsList() );
143143

144144
//! Creates a new QgsColorRamp from a map of properties
145-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
145+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
146146

147147
virtual int count() const override { return mStops.count() + 2; }
148148
virtual double value( int index ) const override;
@@ -439,7 +439,7 @@ class CORE_EXPORT QgsPresetSchemeColorRamp : public QgsColorRamp, public QgsColo
439439
* \param properties color ramp properties
440440
* \see properties()
441441
*/
442-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
442+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
443443

444444
/** Sets the list of colors used by the ramp.
445445
* \param colors list of colors
@@ -496,7 +496,7 @@ class CORE_EXPORT QgsColorBrewerColorRamp : public QgsColorRamp
496496
* \param properties color ramp properties
497497
* \see properties()
498498
*/
499-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
499+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
500500

501501
virtual double value( int index ) const override;
502502
virtual QColor color( double value ) const override;
@@ -586,7 +586,7 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp
586586
const QString &variantName = QString(), bool inverted = false,
587587
bool doLoadFile = true );
588588

589-
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
589+
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
590590

591591
virtual QString type() const override { return QStringLiteral( "cpt-city" ); }
592592

‎src/core/symbology-ng/qgssymbollayerregistry.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CORE_EXPORT QgsSymbolLayerAbstractMetadata
5050
//! Create widget for symbol layer of this type. Can return NULL if there's no GUI
5151
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer * ) SIP_FACTORY { return nullptr; }
5252
//! Create a symbol layer of this type given the map of properties.
53-
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) { return nullptr; }
53+
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) SIP_FACTORY { return nullptr; }
5454

5555
/** Resolve paths in symbol layer's properties (if there are any paths).
5656
* When saving is true, paths are converted from absolute to relative,
@@ -109,9 +109,9 @@ class CORE_EXPORT QgsSymbolLayerMetadata : public QgsSymbolLayerAbstractMetadata
109109
//! \note not available in Python bindings
110110
void setWidgetFunction( QgsSymbolLayerWidgetFunc f ) { mWidgetFunc = f; } SIP_SKIP
111111

112-
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) override { return mCreateFunc ? mCreateFunc( map ) : nullptr; } SIP_FACTORY
113-
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) override { return mWidgetFunc ? mWidgetFunc( vl ) : nullptr; } SIP_FACTORY
114-
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) override { return mCreateFromSldFunc ? mCreateFromSldFunc( elem ) : nullptr; } SIP_FACTORY
112+
virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) override SIP_FACTORY { return mCreateFunc ? mCreateFunc( map ) : nullptr; }
113+
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) override SIP_FACTORY { return mWidgetFunc ? mWidgetFunc( vl ) : nullptr; }
114+
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) override SIP_FACTORY { return mCreateFromSldFunc ? mCreateFromSldFunc( elem ) : nullptr; }
115115
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving ) override
116116
{
117117
if ( mPathResolverFunc )
@@ -159,7 +159,7 @@ class CORE_EXPORT QgsSymbolLayerRegistry
159159
QgsSymbolLayer *createSymbolLayer( const QString &name, const QgsStringMap &properties = QgsStringMap() ) const SIP_FACTORY;
160160

161161
//! create a new instance of symbol layer given symbol layer name and SLD
162-
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
162+
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const SIP_FACTORY;
163163

164164
/** Resolve paths in properties of a particular symbol layer.
165165
* This normally means converting relative paths to absolute paths when loading

‎src/core/symbology-ng/qgssymbollayerutils.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ class CORE_EXPORT QgsSymbolLayerUtils
254254

255255
static bool createSymbolLayerListFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType, QgsSymbolLayerList &layers );
256256

257-
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
258-
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
259-
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
257+
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) SIP_FACTORY;
258+
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) SIP_FACTORY;
259+
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) SIP_FACTORY;
260260

261261
static bool convertPolygonSymbolizerToPointMarker( QDomElement &element, QgsSymbolLayerList &layerList );
262262
static bool hasExternalGraphic( QDomElement &element );
@@ -395,7 +395,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
395395
*
396396
* \see colorRampToVariant()
397397
*/
398-
static QgsColorRamp *loadColorRamp( const QVariant &value );
398+
static QgsColorRamp *loadColorRamp( const QVariant &value ) SIP_FACTORY;
399399

400400
/**
401401
* Returns a friendly display name for a color
@@ -421,7 +421,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
421421
* \see colorFromMimeData
422422
* \since QGIS 2.5
423423
*/
424-
static QMimeData *colorToMimeData( const QColor &color );
424+
static QMimeData *colorToMimeData( const QColor &color ) SIP_FACTORY;
425425

426426
/**
427427
* Attempts to parse mime data as a color
@@ -449,7 +449,7 @@ class CORE_EXPORT QgsSymbolLayerUtils
449449
* \returns mime data containing encoded colors
450450
* \since QGIS 2.5
451451
*/
452-
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true );
452+
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) SIP_FACTORY;
453453

454454
/**
455455
* Exports colors to a gpl GIMP palette file

0 commit comments

Comments
 (0)
Please sign in to comment.