7 changes: 6 additions & 1 deletion src/core/symbology-ng/qgsrendererv2registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata
public:

/** construct metadata */
//! @note not available in python bindings
QgsRendererV2Metadata( QString name,
QString visibleName,
QgsRendererV2CreateFunc pfCreate,
Expand All @@ -89,6 +90,7 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata
, mCreateFromSldFunc( NULL )
{}

//! @note not available in python bindings
QgsRendererV2Metadata( QString name,
QString visibleName,
QgsRendererV2CreateFunc pfCreate,
Expand All @@ -107,11 +109,14 @@ class CORE_EXPORT QgsRendererV2Metadata : public QgsRendererV2AbstractMetadata
virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType )
{ return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NULL; }


//! @note not available in python bindings
QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; }
//! @note not available in python bindings
QgsRendererV2WidgetFunc widgetFunction() const { return mWidgetFunc; }
//! @note not available in python bindings
QgsRendererV2CreateFromSldFunc createFromSldFunction() const { return mCreateFromSldFunc; }

//! @note not available in python bindings
void setWidgetFunction( QgsRendererV2WidgetFunc f ) { mWidgetFunc = f; }

protected:
Expand Down
17 changes: 8 additions & 9 deletions src/core/symbology-ng/qgsstylev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,20 @@ enum TagmapTable { TagmapTagId, TagmapSymbolId };
enum ColorrampTable { ColorrampId, ColorrampName, ColorrampXML, ColorrampGroupId };
enum SmartgroupTable { SmartgroupId, SmartgroupName, SmartgroupXML };

//! Enum for Entities involved in a style
/*!
The enumarator is used for identifying the entity being operated on when generic
database functions are being run.
\sa group(), rename(), remove(), symbolsOfGroup(), symbolsWithTag(), symbolsOfSmartgroup()
*/
enum StyleEntity { SymbolEntity, GroupEntity, TagEntity, ColorrampEntity, SmartgroupEntity };

class CORE_EXPORT QgsStyleV2
{
public:

QgsStyleV2();
~QgsStyleV2();

//! Enum for Entities involved in a style
/*!
The enumerator is used for identifying the entity being operated on when generic
database functions are being run.
\sa group(), rename(), remove(), symbolsOfGroup(), symbolsWithTag(), symbolsOfSmartgroup()
*/
enum StyleEntity { SymbolEntity, GroupEntity, TagEntity, ColorrampEntity, SmartgroupEntity };

//! add color ramp to style. takes ramp's ownership
/*!
* \note Adding a color ramp with the name of existing one replaces it.
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2
double mAngle;
};

class QgsSymbolLayerV2Widget;
class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here

#endif
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgssymbollayerv2utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
static bool fillFromSld( QDomElement &element,
Qt::BrushStyle &brushStyle, QColor &color );

//! @note not available in python bindings
static void lineToSld( QDomDocument &doc, QDomElement &element,
Qt::PenStyle penStyle, QColor color, double width = -1,
const Qt::PenJoinStyle *penJoinStyle = 0, const Qt::PenCapStyle *penCapStyle = 0,
Expand Down
24 changes: 12 additions & 12 deletions src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ void QgsStyleV2ManagerDialog::groupChanged( const QModelIndex& index )
QStringList symbolNames;
QStringList groupSymbols;

StyleEntity type = currentItemType() < 3 ? SymbolEntity : ColorrampEntity;
QgsStyleV2::StyleEntity type = currentItemType() < 3 ? QgsStyleV2::SymbolEntity : QgsStyleV2::ColorrampEntity;
if ( currentItemType() > 3 )
{
QgsDebugMsg( "Entity not implemented" );
Expand Down Expand Up @@ -936,11 +936,11 @@ void QgsStyleV2ManagerDialog::removeGroup()
QStandardItem *parentItem = model->itemFromIndex( index.parent() );
if ( parentItem->data( Qt::UserRole + 1 ).toString() == "smartgroups" )
{
mStyle->remove( SmartgroupEntity, index.data( Qt::UserRole + 1 ).toInt() );
mStyle->remove( QgsStyleV2::SmartgroupEntity, index.data( Qt::UserRole + 1 ).toInt() );
}
else
{
mStyle->remove( GroupEntity, index.data( Qt::UserRole + 1 ).toInt() );
mStyle->remove( QgsStyleV2::GroupEntity, index.data( Qt::UserRole + 1 ).toInt() );
QStandardItem *item = model->itemFromIndex( index );
if ( item->hasChildren() )
{
Expand Down Expand Up @@ -989,11 +989,11 @@ void QgsStyleV2ManagerDialog::groupRenamed( QStandardItem * item )
QString name = item->text();
if ( item->parent()->data( Qt::UserRole + 1 ) == "smartgroups" )
{
mStyle->rename( SmartgroupEntity, id, name );
mStyle->rename( QgsStyleV2::SmartgroupEntity, id, name );
}
else
{
mStyle->rename( GroupEntity, id, name );
mStyle->rename( QgsStyleV2::GroupEntity, id, name );
}
}
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@ void QgsStyleV2ManagerDialog::groupSymbolsAction()

void QgsStyleV2ManagerDialog::regrouped( QStandardItem *item )
{
StyleEntity type = ( currentItemType() < 3 ) ? SymbolEntity : ColorrampEntity;
QgsStyleV2::StyleEntity type = ( currentItemType() < 3 ) ? QgsStyleV2::SymbolEntity : QgsStyleV2::ColorrampEntity;
if ( currentItemType() > 3 )
{
QgsDebugMsg( "Unknown style entity" );
Expand Down Expand Up @@ -1118,14 +1118,14 @@ void QgsStyleV2ManagerDialog::tagsChanged()
QStringList oldtags = mTagList;
QStringList newtags = tagsLineEdit->text().split( ",", QString::SkipEmptyParts );

StyleEntity type;
QgsStyleV2::StyleEntity type;
if ( currentItemType() < 3 )
{
type = SymbolEntity;
type = QgsStyleV2::SymbolEntity;
}
else if ( currentItemType() == 3 )
{
type = ColorrampEntity;
type = QgsStyleV2::ColorrampEntity;
}
else
{
Expand Down Expand Up @@ -1165,7 +1165,7 @@ void QgsStyleV2ManagerDialog::symbolSelected( const QModelIndex& index )
// Populate the tags for the symbol
tagsLineEdit->clear();
QStandardItem *item = static_cast<QStandardItemModel*>( listItems->model() )->itemFromIndex( index );
StyleEntity type = ( currentItemType() < 3 ) ? SymbolEntity : ColorrampEntity;
QgsStyleV2::StyleEntity type = ( currentItemType() < 3 ) ? QgsStyleV2::SymbolEntity : QgsStyleV2::ColorrampEntity;
mTagList = mStyle->tagsOfSymbol( type, item->data().toString() );
tagsLineEdit->setText( mTagList.join( "," ) );
}
Expand Down Expand Up @@ -1283,7 +1283,7 @@ void QgsStyleV2ManagerDialog::listitemsContextMenu( const QPoint& point )

if ( selectedItem )
{
StyleEntity type = ( currentItemType() < 3 ) ? SymbolEntity : ColorrampEntity;
QgsStyleV2::StyleEntity type = ( currentItemType() < 3 ) ? QgsStyleV2::SymbolEntity : QgsStyleV2::ColorrampEntity;
if ( currentItemType() > 3 )
{
QgsDebugMsg( "unknow entity type" );
Expand Down Expand Up @@ -1328,7 +1328,7 @@ void QgsStyleV2ManagerDialog::editSmartgroupAction()
if ( dlg.exec() == QDialog::Rejected )
return;

mStyle->remove( SmartgroupEntity, item->data().toInt() );
mStyle->remove( QgsStyleV2::SmartgroupEntity, item->data().toInt() );
int id = mStyle->addSmartgroup( dlg.smartgroupName(), dlg.conditionOperator(), dlg.conditionMap() );
if ( !id )
{
Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology-ng/qgssymbolslistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ void QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged( int index )
if ( groupsCombo->itemData( index ).toString() == "smart" )
{
groupid = mStyle->smartgroupId( text );
symbols = mStyle->symbolsOfSmartgroup( SymbolEntity, groupid );
symbols = mStyle->symbolsOfSmartgroup( QgsStyleV2::SymbolEntity, groupid );
}
else
{
groupid = groupsCombo->itemData( index ).toInt();
symbols = mStyle->symbolsOfGroup( SymbolEntity, groupid );
symbols = mStyle->symbolsOfGroup( QgsStyleV2::SymbolEntity, groupid );
}
}
populateSymbols( symbols );
Expand Down