Add some missing type conversions to python bindings

This commit is contained in:
Nyall Dawson 2015-01-20 22:36:36 +11:00
parent c6a77f6201
commit 6a080bada1
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
%ModuleHeaderCode
// fix to allow compilation with sip 4.7
#include <qgscomposerhtml.h>
#include <qgscomposertablev2.h>
#include <qgscomposerattributetablev2.h>
%End
/**
* \ingroup composer
@ -9,7 +15,20 @@
class QgsComposerMultiFrame: QgsComposerObject
{
%TypeHeaderCode
#include "qgscomposermultiframe.h"
#include <qgscomposermultiframe.h>
%End
%ConvertToSubClassCode
if (dynamic_cast<QgsComposerHtml*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerHtml;
else if (dynamic_cast<QgsComposerAttributeTableV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerAttributeTableV2;
else if (dynamic_cast<QgsComposerTableV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerTableV2;
else if (dynamic_cast<QgsComposerMultiFrame*>(sipCpp) != NULL)
sipClass = sipClass_QgsComposerMultiFrame;
else
sipClass = NULL;
%End
public:

View File

@ -42,6 +42,12 @@ class QgsFeatureRendererV2
sipClass = sipClass_QgsGraduatedSymbolRendererV2;
else if (sipCpp->type() == "RuleRenderer")
sipClass = sipClass_QgsRuleBasedRendererV2;
else if (sipCpp->type() == "heatmapRenderer")
sipClass = sipClass_QgsHeatmapRenderer;
else if (sipCpp->type() == "invertedPolygonRenderer")
sipClass = sipClass_QgsInvertedPolygonRenderer;
else if (sipCpp->type() == "pointDisplacement")
sipClass = sipClass_QgsPointDisplacementRenderer;
else
sipClass = 0;
%End

View File

@ -43,11 +43,17 @@ class QgsSymbolLayerV2
sipClass = sipClass_QgsPointPatternFillSymbolLayer;
else if (dynamic_cast<QgsSVGFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsSVGFillSymbolLayer;
else if (dynamic_cast<QgsRasterFillSymbolLayer*>(sipCpp) != NULL)
sipClass = sipClass_QgsRasterFillSymbolLayer;
else
sipClass = sipClass_QgsImageFillSymbolLayer;
}
else if (dynamic_cast<QgsCentroidFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsCentroidFillSymbolLayerV2;
else if (dynamic_cast<QgsGradientFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsGradientFillSymbolLayerV2;
else if (dynamic_cast<QgsShapeburstFillSymbolLayerV2*>(sipCpp) != NULL)
sipClass = sipClass_QgsShapeburstFillSymbolLayerV2;
else
sipClass = sipClass_QgsFillSymbolLayerV2;
break;