243 changes: 220 additions & 23 deletions python/core/qgsvectorlayer.sip

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions python/core/raster/qgssinglebandpseudocolorrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
/** Takes ownership of the shader*/
void setShader( QgsRasterShader* shader /Transfer/ );
QgsRasterShader* shader();
//! @note available in python as constShader
const QgsRasterShader* shader() const /PyName=constShader/;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
Expand Down
3 changes: 3 additions & 0 deletions python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2

virtual ~QgsCategorizedSymbolRendererV2();

//! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;

//! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
Expand All @@ -64,6 +66,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();

//! @note available in python as symbols2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
void updateSymbols( QgsSymbolV2 * sym );

Expand Down
4 changes: 3 additions & 1 deletion python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2

virtual ~QgsGraduatedSymbolRendererV2();

//! @note labelForLowerUpper in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;

//! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
Expand All @@ -106,6 +107,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();

//! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;

QString classAttribute() const;
Expand Down
2 changes: 2 additions & 0 deletions python/core/symbology-ng/qgsheatmaprenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class QgsHeatmapRenderer : QgsFeatureRendererV2
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
virtual void stopRender( QgsRenderContext& context );
//! @note symbolForFeature2 in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
//! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QString dump() const;
virtual QList<QString> usedAttributes();
Expand Down
24 changes: 18 additions & 6 deletions python/core/symbology-ng/qgsinvertedpolygonrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,35 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbol2
*/
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbolForFeature2
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as originalSymbolForFeature2
*/
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbolsForFeature
*/
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as originalSymbolsForFeature2
*/
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
/** Proxy that will call this method on the embedded renderer.
@note not available in python bindings
*/
// virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" );
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;

/** Creates a renderer out of an XML, for loading*/
Expand Down
24 changes: 18 additions & 6 deletions python/core/symbology-ng/qgspointdisplacementrenderer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,29 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2
virtual QList<QString> usedAttributes();
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities();
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbols2
*/
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolForFeature2
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolForFeature2
*/
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolsForFeature2
*/
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolsForFeature2
*/
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
Expand Down
3 changes: 2 additions & 1 deletion python/core/symbology-ng/qgsrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class QgsFeatureRendererV2
* @note added in QGIS 2.12
* @note available in Python bindings as symbolForFeature2
*/
//TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
// TODO - QGIS 3.0 make pure virtual when above method is removed
// TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;

/**
Expand Down
138 changes: 136 additions & 2 deletions python/core/symbology-ng/qgsrulebasedrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,67 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
~Rule();
QString dump( int offset = 0 ) const;
QSet<QString> usedAttributes();

//! @note available in python bindings as symbol2
QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() ) /PyName=symbols2/;

//! @note not available in python bindings
// QgsLegendSymbolList legendSymbolItems();

//! @note added in 2.6
QgsLegendSymbolListV2 legendSymbolItemsV2( int currentLevel = -1 ) const;
bool isFilterOK( QgsFeature& f, QgsRenderContext* context = 0 ) const;

/**
* Check if a given feature shall be rendered by this rule
*
* @param f The feature to test
* @param context The context in which the rendering happens
* @return True if the feature shall be rendered
*/
bool isFilterOK( QgsFeature& f, QgsRenderContext *context = 0 ) const;

/**
* Check if this rule applies for a given scale
* @param scale The scale to check. If set to 0, it will always return true.
*
* @return If the rule will be evaluated at this scale
*/
bool isScaleOK( double scale ) const;

QgsSymbolV2* symbol();
QString label() const;
bool dependsOnScale() const;
int scaleMinDenom() const;
int scaleMaxDenom() const;

/**
* A filter that will check if this rule applies
* @return An expression
*/
QgsExpression* filter() const;

/**
* A filter that will check if this rule applies
* @return An expression
*/
QString filterExpression() const;

/**
* A human readable description for this rule
*
* @return Description
*/
QString description() const;

//! @note added in 2.6
bool checkState() const;
//! @deprecated use active instead
bool checkState() const /Deprecated/;
/**
* Returns if this rule is active
*
* @return True if the rule is active
*/
bool active() const;

//! Unique rule identifier (for identification of rule within renderer)
//! @note added in 2.6
Expand All @@ -96,13 +139,41 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! set a new symbol (or NULL). Deletes old symbol.
void setSymbol( QgsSymbolV2* sym /Transfer/ );
void setLabel( const QString& label );

/**
* Set the minimum denominator for which this rule shall apply.
* E.g. 1000 if it shall be evaluated between 1:1000 and 1:100'000
* Set to 0 to disable the minimum check
* @param scaleMinDenom The minimum scale denominator for this rule
*/
void setScaleMinDenom( int scaleMinDenom );

/**
* Set the maximum denominator for which this rule shall apply.
* E.g. 100'000 if it shall be evaluated between 1:1000 and 1:100'000
* Set to 0 to disable the maximum check
* @param scaleMaxDenom maximum scale denominator for this rule
*/
void setScaleMaxDenom( int scaleMaxDenom );

/**
* Set the expression used to check if a given feature shall be rendered with this rule
*
* @param filterExp An expression
*/
void setFilterExpression( const QString& filterExp );

/**
* Set a human readable description for this rule
*
* @param description Description
*/
void setDescription( const QString& description );

//! @note added in 2.6
//! @deprecated use setActive instead
void setCheckState( bool state );

/**
* Sets if this rule is active
* @param state Determines if the rule should be activated or deactivated
Expand All @@ -119,14 +190,26 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2

//! prepare the rule for rendering and its children (build active children array)
bool startRender( QgsRenderContext& context, const QgsFields& fields ) /Deprecated/;

//! prepare the rule for rendering and its children (build active children array)
bool startRender( QgsRenderContext& context, const QgsFields& fields, QString& filter );

//! get all used z-levels from this rule and children
QSet<int> collectZLevels();

//! assign normalized z-levels [0..N-1] for this rule's symbol for quick access during rendering
//! @note not available in python bindings
// void setNormZLevels( const QMap<int, int>& zLevelsToNormLevels );

/**
* Render a given feature, will recursively call subclasses and only render if the constraints apply.
*
* @param featToRender The feature to render
* @param context The rendering context
* @param renderQueue The rendering queue to which the feature should be added
* @return The result of the rendering. In explicit if the feature is added to the queue or
* the reason for not rendering the feature.
*/
QgsRuleBasedRendererV2::Rule::RenderResult renderFeature( QgsRuleBasedRendererV2::FeatureToRender& featToRender, QgsRenderContext& context, QgsRuleBasedRendererV2::RenderQueue& renderQueue );

//! only tell whether a feature will be rendered without actually rendering it
Expand All @@ -138,34 +221,85 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2
//! tell which rules will be used to render the feature
QList<QgsRuleBasedRendererV2::Rule*> rulesForFeature( QgsFeature& feat, QgsRenderContext* context = 0 );

/**
* Stop a rendering process. Used to clean up the internal state of this rule
*
* @param context The rendering context
*/
void stopRender( QgsRenderContext& context );

/**
* Create a rule from an XML definition
*
* @param ruleElem The XML rule element
* @param symbolMap Symbol map
*
* @return A new rule
*/
static QgsRuleBasedRendererV2::Rule* create( QDomElement& ruleElem, QgsSymbolV2Map& symbolMap ) /Factory/;

/**
* Return all children rules of this rule
*
* @return A list of rules
*/
QList<QgsRuleBasedRendererV2::Rule*>& children();

/**
* Returns all children, grand-children, grand-grand-children, grand-gra... you get it
*
* @return A list of descendant rules
*/
QList<QgsRuleBasedRendererV2::Rule*> descendants() const;

/**
* The parent rule
*
* @return Parent rule
*/
QgsRuleBasedRendererV2::Rule* parent();

//! add child rule, take ownership, sets this as parent
void appendChild( QgsRuleBasedRendererV2::Rule* rule /Transfer/ );

//! add child rule, take ownership, sets this as parent
void insertChild( int i, QgsRuleBasedRendererV2::Rule* rule /Transfer/ );

//! delete child rule
void removeChild( QgsRuleBasedRendererV2::Rule* rule );

//! delete child rule
void removeChildAt( int i );

//! take child rule out, set parent as null
void takeChild( QgsRuleBasedRendererV2::Rule* rule );

//! take child rule out, set parent as null
QgsRuleBasedRendererV2::Rule* takeChildAt( int i ) /TransferBack/;

//! Try to find a rule given its unique key
//! @note added in 2.6
QgsRuleBasedRendererV2::Rule* findRuleByKey( const QString& key );

/**
* Check which child rules are else rules and update the internal list of else rules
*
* TODO QGIS 3: Does this need to be public?
*/
void updateElseRules();

/**
* Sets if this rule is an ELSE rule
*
* @param iselse If true, this rule is an ELSE rule
*/
void setIsElse( bool iselse );

/**
* Check if this rule is an ELSE rule
*
* @return True if this rule is an else rule
*/
bool isElse();

protected:
Expand Down
3 changes: 3 additions & 0 deletions python/core/symbology-ng/qgssinglesymbolrendererv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2

virtual ~QgsSingleSymbolRendererV2();

//! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;

//! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
Expand Down Expand Up @@ -41,6 +43,7 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities();

//! @note available in python as symbol2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/;

//! create renderer from XML element
Expand Down
1 change: 1 addition & 0 deletions python/core/symbology-ng/qgssymbollayerv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
//handles marker offset and anchor point shift together
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;

//! @note available in python as markerOffsetWithWidthAndHeight
void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const /PyName=markerOffsetWithWidthAndHeight/;

//! @note available in python bindings as markerOffset2
Expand Down
4 changes: 3 additions & 1 deletion python/core/symbology-ng/qgssymbollayerv2utils.sip
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class QgsSymbolLayerV2Utils
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size ) /Deprecated/;

//! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size ) /PyName=wellKnownMarkerFromSld2/;
Expand All @@ -175,7 +177,7 @@ class QgsSymbolLayerV2Utils


static void labelTextToSld( QDomDocument &doc, QDomElement &element, const QString& label,
const QFont& font, const QColor& color = QColor(), double size = -1 );
const QFont &font, const QColor& color = QColor(), double size = -1 );

/** Create ogr feature style string for pen */
static QString ogrFeatureStylePen( double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor& c,
Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsifeatureselectionmanager.sip
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* Is an interface class to abstract feature selection handling.
*
* e.g. @link{QgsVectorLayer} implements this interface to manage its selections.
* e.g. { @link QgsVectorLayer } implements this interface to manage its selections.
*/

class QgsIFeatureSelectionManager : QObject
Expand Down
21 changes: 18 additions & 3 deletions python/gui/qgscollapsiblegroupbox.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QgsGroupBoxCollapseButton : QToolButton
* Holding Alt modifier key when toggling collapsed state will synchronize the toggling across other collapsible group boxes with the same syncGroup QString value
* Holding Shift modifier key when attempting to toggle collapsed state will expand current group box, then collapse any others with the same syncGroup QString value
* @note To add Collapsible properties in promoted QtDesigner widgets, you can add the following "Dynamic properties" by clicking on the green + in the propreties palette:
* bool collapsed, QString syncGroup
* bool collapsed, QString syncGroup, bool scrollOnExpand
*/

class QgsCollapsibleGroupBoxBasic : QGroupBox
Expand All @@ -35,16 +35,31 @@ class QgsCollapsibleGroupBoxBasic : QGroupBox
QgsCollapsibleGroupBoxBasic( const QString &title, QWidget *parent /TransferThis/ = 0 );
~QgsCollapsibleGroupBoxBasic();

/**
* Returns the current collapsed state of this group box
*/
bool isCollapsed() const;
/**
* Collapse or uncollapse this groupbox
*
* @param collapse Will collapse on true and uncollapse on false
*/
void setCollapsed( bool collapse );

/** Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key */
/**
* Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key
*/
QString syncGroup() const;

/**
* Named group which synchronizes collapsing action when triangle is clicked while holding alt modifier key
*/
void setSyncGroup( const QString& grp );

//! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
//! Set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
void setScrollOnExpand( bool scroll );

//! If this is set to false the parent QScrollArea will not be automatically scrolled to this widget's contents when expanded
bool scrollOnExpand();

signals:
Expand Down
1 change: 1 addition & 0 deletions src/core/dxf/qgsdxfexport.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CORE_EXPORT QgsDxfExport
void writeInt( int i );
void writeDouble( double d );
void writeString( const QString &s );
//! @note available in python bindings as writeGroupPoint
void writeGroup( int code, const QgsPoint &p, double z = 0.0, bool skipz = false );
void writeGroup( const QColor& color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );

Expand Down
1 change: 1 addition & 0 deletions src/core/qgsdataitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ class CORE_EXPORT QgsZipItem : public QgsDataCollectionItem
static QString vsiPrefix( const QString& uri ) { return qgsVsiPrefix( uri ); }

static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QString name );
//! @note available in python as itemFromFilePath
static QgsDataItem* itemFromPath( QgsDataItem* parent, const QString& filePath, const QString& name, const QString& path );

static const QIcon &iconZip();
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsdatasourceuri.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class CORE_EXPORT QgsDataSourceURI
//! Set generic param (generic mode)
// \note if key exists, another is inserted
void setParam( const QString &key, const QString &value );
//! @note available in python as setParamList
void setParam( const QString &key, const QStringList &value );

//! Remove generic param (generic mode)
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsgml.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class CORE_EXPORT QgsGml : public QObject
* @param password password for authentication
* @param authcfg authentication configuration id
* @return 0 in case of success
* @note available in python as getFeaturesUri
*/
int getFeatures( const QString& uri,
QGis::WkbType* wkbType,
Expand Down
17 changes: 13 additions & 4 deletions src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorElement
virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }

/**
* Returns if this ccontainer is going to be rendered as a group box
* Returns if this container is going to be rendered as a group box
*
* @return True if it will be a group box, false if it will be a tab
*/
Expand Down Expand Up @@ -1149,6 +1149,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
* to the given coordinates
* @note available in python as moveVertexV2
*/
bool moveVertex( const QgsPointV2& p, QgsFeatureId atFeatureId, int atVertex );

Expand Down Expand Up @@ -1181,7 +1182,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
0 in case of success
1 problem with feature type
2 ring not closed
6 layer not editable*/
6 layer not editable
@note available in python as addCurvedRing
*/
int addRing( QgsCurveV2* ring, QgsFeatureId* featureId = 0 );

/** Adds a new part polygon to a multipart feature
Expand All @@ -1196,6 +1199,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
7 layer not editable */
int addPart( const QList<QgsPoint>& ring );

//! @note available in python as addCurvedPart
int addPart( QgsCurveV2* ring );

/** Translates feature by dx, dy
Expand Down Expand Up @@ -1897,13 +1901,15 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @see updatedFields()
*/
void attributeAdded( int idx );

/**
* Will be emitted, when an expression field is going to be added to this vector layer.
* Applies only to types {@link QgsFields::OriginExpression }
*
* @param fieldName The name of the attribute to be added
*/
void beforeAddingExpressionField( const QString& fieldName );

/**
* Will be emitted, when an attribute has been deleted from this vector layer.
* Applies only to types {@link QgsFields::OriginEdit}, {@link QgsFields::OriginProvider} and {@link QgsFields::OriginExpression }
Expand All @@ -1913,6 +1919,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @see updatedFields()
*/
void attributeDeleted( int idx );

/**
* Will be emitted, when an expression field is going to be deleted from this vector layer.
* Applies only to types {@link QgsFields::OriginExpression }
Expand All @@ -1927,6 +1934,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param fid The id of the new feature
*/
void featureAdded( QgsFeatureId fid );

/**
* Emitted when a feature has been deleted.
*
Expand All @@ -1936,16 +1944,18 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* @param fid The id of the feature which has been deleted
*/
void featureDeleted( QgsFeatureId fid );

/**
* Emitted when features have been deleted.
*
* If features are deleted within an edit command, this will only be emitted once at the end
* to allow connected slots to minimize the overhead.
* If features are delted outside of an edit command, this signal will be emitted once per feature.
* If features are deleted outside of an edit command, this signal will be emitted once per feature.
*
* @param fids The feature ids that have been deleted.
*/
void featuresDeleted( const QgsFeatureIds& fids );

/**
* Is emitted, whenever the fields available from this layer have been changed.
* This can be due to manually adding attributes or due to a join.
Expand Down Expand Up @@ -2018,7 +2028,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
*/
void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;


private slots:
void onRelationsLoaded();
void onJoinedFieldsChanged();
Expand Down
1 change: 1 addition & 0 deletions src/core/raster/qgssinglebandpseudocolorrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
/** Takes ownership of the shader*/
void setShader( QgsRasterShader* shader );
QgsRasterShader* shader() { return mShader; }
//! @note available in python as constShader
const QgsRasterShader* shader() const { return mShader; }

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const override;
Expand Down
3 changes: 3 additions & 0 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2

virtual ~QgsCategorizedSymbolRendererV2();

//! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;

//! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
Expand All @@ -95,6 +97,7 @@ class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField | Filter; }

//! @note available in python as symbols2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
void updateSymbols( QgsSymbolV2 * sym );

Expand Down
4 changes: 3 additions & 1 deletion src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2

virtual ~QgsGraduatedSymbolRendererV2();

//! @note labelForLowerUpper in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;

//! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
Expand All @@ -139,6 +140,7 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField | Filter; }

//! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext &context ) override;

QString classAttribute() const { return mAttrName; }
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsheatmaprenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ class CORE_EXPORT QgsHeatmapRenderer : public QgsFeatureRendererV2
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false ) override;
virtual void stopRender( QgsRenderContext& context ) override;
//! @note symbolForFeature2 in python bindings
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext &context ) override;
//! @note symbol2 in python bindings
virtual QgsSymbolV2List symbols( QgsRenderContext &context ) override;
virtual QString dump() const override;
virtual QList<QString> usedAttributes() override;
Expand Down
24 changes: 18 additions & 6 deletions src/core/symbology-ng/qgsinvertedpolygonrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,35 @@ class CORE_EXPORT QgsInvertedPolygonRenderer : public QgsFeatureRendererV2
virtual QList<QString> usedAttributes() override;
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities() override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbol2
*/
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbolForFeature2
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as originalSymbolForFeature2
*/
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as symbolsForFeature
*/
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as originalSymbolsForFeature2
*/
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ) override;
/** Proxy that will call this method on the embedded renderer.
@note not available in python bindings
*/
virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python bindings as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) override;

/** Creates a renderer out of an XML, for loading*/
Expand Down
24 changes: 18 additions & 6 deletions src/core/symbology-ng/qgspointdisplacementrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,29 @@ class CORE_EXPORT QgsPointDisplacementRenderer: public QgsFeatureRendererV2
virtual QList<QString> usedAttributes() override;
/** Proxy that will call this method on the embedded renderer. */
virtual int capabilities() override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbols2
*/
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolForFeature2
*/
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolForFeature2
*/
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolsForFeature2
*/
virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolsForFeature2
*/
virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) override;
/** Proxy that will call this method on the embedded renderer. */
/** Proxy that will call this method on the embedded renderer.
@note available in python as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) override;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class CORE_EXPORT QgsFeatureRendererV2
* @note added in QGIS 2.12
* @note available in Python bindings as symbolForFeature2
*/
//TODO - QGIS 3.0 make pure virtual when above method is removed
//TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
// TODO - QGIS 3.0 make pure virtual when above method is removed
// TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );

/**
Expand Down
3 changes: 2 additions & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
*/
QSet<QString> usedAttributes();

//! @note available in python bindings as symbol2
QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() );

//! @note not available in python bindings
Expand Down Expand Up @@ -162,7 +163,7 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2

//! @note added in 2.6
//! @deprecated use active instead
bool checkState() const { return mIsActive; }
Q_DECL_DEPRECATED bool checkState() const { return mIsActive; }
/**
* Returns if this rule is active
*
Expand Down
3 changes: 3 additions & 0 deletions src/core/symbology-ng/qgssinglesymbolrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2

virtual ~QgsSingleSymbolRendererV2();

//! @note available in python as symbolForFeature2
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;

//! @note available in python as originalSymbolForFeature2
virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) override;

virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) override;
Expand Down Expand Up @@ -62,6 +64,7 @@ class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2
//! returns bitwise OR-ed capabilities of the renderer
virtual int capabilities() override { return SymbolLevels | RotationField; }

//! @note available in python as symbol2
virtual QgsSymbolV2List symbols( QgsRenderContext& context ) override;

//! create renderer from XML element
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgssymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2
//handles marker offset and anchor point shift together
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, double& offsetY ) const;

//! @note available in python as markerOffsetWithWidthAndHeight
void markerOffset( QgsSymbolV2RenderContext& context, double width, double height, double& offsetX, double& offsetY ) const;

//! @note available in python bindings as markerOffset2
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgssymbollayerv2utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
Q_DECL_DEPRECATED static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor,
double &borderWidth, double &size );

//! @note available in python as wellKnownMarkerFromSld2
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle,
double &borderWidth, double &size );
Expand Down
8 changes: 8 additions & 0 deletions tests/src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@ ENDIF (ENABLE_PGTEST)
IF (WITH_APIDOC)
ADD_PYTHON_TEST(PyQgsDocCoverage test_qgsdoccoverage.py)
#SIP coverage test relies on API doc parsing to identify members which should be in bindings
SET(MISSING_SIP_CLASSES 0)
SET(MISSING_SIP_MEMBERS 0)

IF(NOT QSCI_SIP_DIR)
MATH(EXPR MISSING_SIP_CLASSES "${MISSING_SIP_CLASSES}+2") # QgsCodeEditor, QgsCodeEditorPython
ENDIF(NOT QSCI_SIP_DIR)

ADD_PYTHON_TEST(PyQgsSipCoverage test_qgssipcoverage.py)
SET_PROPERTY(TEST PyQgsSipCoverage PROPERTY ENVIRONMENT "MISSING_SIP_CLASSES=${MISSING_SIP_CLASSES}" "MISSING_SIP_MEMBERS=${MISSING_SIP_MEMBERS}")
ENDIF (WITH_APIDOC)

IF (WITH_SERVER)
Expand Down
6 changes: 6 additions & 0 deletions tests/src/python/test_qgssipcoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,10 @@ def testCoverage(self):


if __name__ == '__main__':
if "MISSING_SIP_CLASSES" in os.environ:
ACCEPTABLE_MISSING_CLASSES -= int(os.environ['MISSING_SIP_CLASSES'])

if "MISSING_SIP_MEMBERS" in os.environ:
ACCEPTABLE_MISSING_MEMBERS -= int(os.environ['MISSING_SIP_MEMBERS'])

unittest.main()
16 changes: 16 additions & 0 deletions tests/src/python/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ def elemIsBindableMember(self, elem):
if not self.visibility(elem) in ('public', 'protected'):
return False

# property themselves are not bound, only getters and setters
if self.isProperty(elem):
return False

if self.isVariable(elem) and self.visibility(elem) == 'protected':
#protected variables can't be bound in SIP
return False
Expand Down Expand Up @@ -649,6 +653,18 @@ def isVariable(self, member_elem):

return False

def isProperty(self, member_elem):
""" Tests whether an member is a property
:param member_elem: XML element for a class member
"""
try:
if member_elem.get('kind') == 'property':
return True
except:
pass

return False

def isDestructor(self, member_elem):
""" Tests whether an member is a destructor
:param member_elem: XML element for a class member
Expand Down