Skip to content
Permalink
Browse files

Add some missing /Factory/ annotations

  • Loading branch information
nyalldawson committed Jul 24, 2017
1 parent 43d094e commit 15f3bbf9c805e038fde89736d91f37cd8c2a6e23
@@ -144,7 +144,7 @@ class QgsGradientColorRamp : QgsColorRamp
\param stops optional list of additional color stops
%End

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

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

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

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
%Docstring
:rtype: QgsColorRamp
%End
@@ -52,7 +52,7 @@ Create a symbol layer of this type given the map of properties.
Create widget for symbol layer of this type. Can return NULL if there's no GUI
:rtype: QgsSymbolLayerWidget
%End
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & );
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) /Factory/;
%Docstring
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
@@ -85,9 +85,9 @@ Convenience metadata class that uses static functions to create symbol layer and



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

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

QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const;
QgsSymbolLayer *createSymbolLayerFromSld( const QString &name, QDomElement &element ) const /Factory/;
%Docstring
create a new instance of symbol layer given symbol layer name and SLD
:rtype: QgsSymbolLayer
@@ -337,15 +337,15 @@ Writes a symbol definition to XML
:rtype: bool
%End

static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) /Factory/;
%Docstring
:rtype: QgsSymbolLayer
%End
@@ -577,7 +577,7 @@ Writes a collection of symbols to XML with specified tagName for the top-level e
:rtype: QVariant
%End

static QgsColorRamp *loadColorRamp( const QVariant &value );
static QgsColorRamp *loadColorRamp( const QVariant &value ) /Factory/;
%Docstring
Load a color ramp from a QVariantMap, wrapped in a QVariant.
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
:rtype: list of QColor
%End

static QMimeData *colorToMimeData( const QColor &color );
static QMimeData *colorToMimeData( const QColor &color ) /Factory/;
%Docstring
Creates mime data from a color. Sets both the mime data's color data, and the
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
:rtype: QgsNamedColorList
%End

static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true );
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) /Factory/;
%Docstring
Creates mime data from a list of named colors
\param colorList list of named colors
@@ -142,7 +142,7 @@ class CORE_EXPORT QgsGradientColorRamp : public QgsColorRamp
const QgsGradientStopsList &stops = QgsGradientStopsList() );

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

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

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

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

static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;

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

@@ -50,7 +50,7 @@ class CORE_EXPORT QgsSymbolLayerAbstractMetadata
//! Create widget for symbol layer of this type. Can return NULL if there's no GUI
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer * ) SIP_FACTORY { return nullptr; }
//! Create a symbol layer of this type given the map of properties.
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) { return nullptr; }
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement & ) SIP_FACTORY { return nullptr; }

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

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

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

/** Resolve paths in properties of a particular symbol layer.
* This normally means converting relative paths to absolute paths when loading
@@ -254,9 +254,9 @@ class CORE_EXPORT QgsSymbolLayerUtils

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

static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element );
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) SIP_FACTORY;
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) SIP_FACTORY;
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) SIP_FACTORY;

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

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

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

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

0 comments on commit 15f3bbf

Please sign in to comment.
You can’t perform that action at this time.