Skip to content
Permalink
Browse files

Add missing sip casts for legend nodes

  • Loading branch information
nyalldawson committed Dec 16, 2020
1 parent 869b24e commit e4a91e7659559112c09bcbb3e95d9678201811c7
@@ -26,10 +26,23 @@ and customized look.

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
#include "qgscolorramplegendnode.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
sipType = sipType_QgsSymbolLegendNode;
else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
sipType = sipType_QgsDataDefinedSizeLegendNode;
else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
sipType = sipType_QgsImageLegendNode;
else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
sipType = sipType_QgsRasterSymbolLegendNode;
else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
sipType = sipType_QgsSimpleLegendNode;
else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
sipType = sipType_QgsWmsLegendNode;
else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
sipType = sipType_QgsColorRampLegendNode;
else
sipType = 0;
%End
@@ -49,15 +49,33 @@ class QgsRenderContext;
*/
class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
{
Q_OBJECT
#ifdef SIP_RUN
#include "qgscolorramplegendnode.h"
#endif

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
sipType = sipType_QgsSymbolLegendNode;
else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
sipType = sipType_QgsDataDefinedSizeLegendNode;
else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
sipType = sipType_QgsImageLegendNode;
else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
sipType = sipType_QgsRasterSymbolLegendNode;
else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
sipType = sipType_QgsSimpleLegendNode;
else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
sipType = sipType_QgsWmsLegendNode;
else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
sipType = sipType_QgsColorRampLegendNode;
else
sipType = 0;
SIP_END
#endif

Q_OBJECT

public:

//! Legend node data roles

0 comments on commit e4a91e7

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