fix QgsSymbolLayerV2Metadata sip bindings

This commit is contained in:
Juergen E. Fischer 2012-09-24 14:30:44 +02:00
parent f99cf89562
commit 86217d0a1a
2 changed files with 12 additions and 17 deletions

View File

@ -1,3 +1,5 @@
class QgsSymbolLayerV2Widget /External/;
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFunc )( const QgsStringMap& );
typedef QgsSymbolLayerV2Widget*( *QgsSymbolLayerV2WidgetFunc )( const QgsVectorLayer* );
typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
@ -36,28 +38,15 @@ class QgsSymbolLayerV2Metadata : QgsSymbolLayerV2AbstractMetadata
%End
public:
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
QgsSymbolLayerV2CreateFromSldFunc pfCreateFromSld,
QgsSymbolLayerV2WidgetFunc pfWidget = NULL );
QgsSymbolLayerV2CreateFunc createFunction() const;
QgsSymbolLayerV2WidgetFunc widgetFunction() const;
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const;
void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f );
virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) /Factory/;
virtual QgsSymbolLayerV2Widget* createSymbolLayerWidget( const QgsVectorLayer* vl ) /Factory/;
virtual QgsSymbolLayerV2* createSymbolLayerFromSld( QDomElement& elem ) /Factory/;
private:
QgsSymbolLayerV2Metadata(); // pretend this is private
};
/**
Registry of available symbol layer classes.
Implemented as a singleton.

View File

@ -63,6 +63,7 @@ typedef QgsSymbolLayerV2*( *QgsSymbolLayerV2CreateFromSldFunc )( QDomElement& );
class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMetadata
{
public:
//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
@ -73,6 +74,7 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( NULL )
{}
//! not available in python bindings
QgsSymbolLayerV2Metadata( QString name, QString visibleName,
QgsSymbolV2::SymbolType type,
QgsSymbolLayerV2CreateFunc pfCreate,
@ -84,10 +86,14 @@ class CORE_EXPORT QgsSymbolLayerV2Metadata : public QgsSymbolLayerV2AbstractMeta
, mCreateFromSldFunc( pfCreateFromSld )
{}
//! not available in python bindings
QgsSymbolLayerV2CreateFunc createFunction() const { return mCreateFunc; }
//! not available in python bindings
QgsSymbolLayerV2WidgetFunc widgetFunction() const { return mWidgetFunc; }
//! not available in python bindings
QgsSymbolLayerV2CreateFromSldFunc createFromSldFunction() const { return mCreateFromSldFunc; }
//! not available in python bindings
void setWidgetFunction( QgsSymbolLayerV2WidgetFunc f ) { mWidgetFunc = f; }
virtual QgsSymbolLayerV2* createSymbolLayer( const QgsStringMap& map ) { return mCreateFunc ? mCreateFunc( map ) : NULL; }