Skip to content
Permalink
Browse files

Auxiliary fields for symbol layers

  • Loading branch information
pblottiere committed Oct 9, 2017
1 parent 609249d commit df021570a4eb0e38fd281f9ee893607859064e0d
Showing with 219 additions and 164 deletions.
  1. +2 −2 python/core/symbology/qgssymbollayerregistry.sip
  2. +2 −2 python/gui/symbology/qgsarrowsymbollayerwidget.sip
  3. +2 −2 python/gui/symbology/qgsellipsesymbollayerwidget.sip
  4. +1 −1 python/gui/symbology/qgslayerpropertieswidget.sip
  5. +33 −31 python/gui/symbology/qgssymbollayerwidget.sip
  6. +2 −2 python/gui/symbology/qgssymbolselectordialog.sip
  7. +2 −2 python/gui/symbology/qgsvectorfieldsymbollayerwidget.sip
  8. +0 −2 src/app/CMakeLists.txt
  9. +1 −0 src/app/qgsvectorlayerproperties.cpp
  10. +13 −0 src/core/qgsauxiliarystorage.cpp
  11. +52 −50 src/core/symbology/qgssymbollayer.cpp
  12. +3 −3 src/core/symbology/qgssymbollayerregistry.h
  13. +2 −0 src/gui/CMakeLists.txt
  14. 0 src/{app → gui}/qgsnewauxiliarylayerdialog.cpp
  15. +3 −3 src/{app → gui}/qgsnewauxiliarylayerdialog.h
  16. +1 −1 src/gui/symbology/qgsarrowsymbollayerwidget.cpp
  17. +2 −2 src/gui/symbology/qgsarrowsymbollayerwidget.h
  18. +1 −1 src/gui/symbology/qgsellipsesymbollayerwidget.cpp
  19. +2 −2 src/gui/symbology/qgsellipsesymbollayerwidget.h
  20. +1 −1 src/gui/symbology/qgslayerpropertieswidget.cpp
  21. +2 −2 src/gui/symbology/qgslayerpropertieswidget.h
  22. +50 −15 src/gui/symbology/qgssymbollayerwidget.cpp
  23. +34 −32 src/gui/symbology/qgssymbollayerwidget.h
  24. +2 −2 src/gui/symbology/qgssymbolselectordialog.cpp
  25. +3 −3 src/gui/symbology/qgssymbolselectordialog.h
  26. +1 −1 src/gui/symbology/qgsvectorfieldsymbollayerwidget.cpp
  27. +2 −2 src/gui/symbology/qgsvectorfieldsymbollayerwidget.h
@@ -47,7 +47,7 @@ In C++ you can use QgsSymbolLayerMetadata convenience class.
Create a symbol layer of this type given the map of properties.
:rtype: QgsSymbolLayer
%End
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer * ) /Factory/;
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer * ) /Factory/;
%Docstring
Create widget for symbol layer of this type. Can return NULL if there's no GUI
:rtype: QgsSymbolLayerWidget
@@ -86,7 +86,7 @@ Convenience metadata class that uses static functions to create symbol layer and


virtual QgsSymbolLayer *createSymbolLayer( const QgsStringMap &map ) /Factory/;
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( const QgsVectorLayer *vl ) /Factory/;
virtual QgsSymbolLayerWidget *createSymbolLayerWidget( QgsVectorLayer *vl ) /Factory/;
virtual QgsSymbolLayer *createSymbolLayerFromSld( QDomElement &elem ) /Factory/;
virtual void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );

@@ -16,14 +16,14 @@ class QgsArrowSymbolLayerWidget: QgsSymbolLayerWidget
%End
public:

QgsArrowSymbolLayerWidget( const QgsVectorLayer *layer, QWidget *parent /TransferThis/ = 0 );
QgsArrowSymbolLayerWidget( QgsVectorLayer *layer, QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor
\param layer the layer where this symbol layer is applied
\param parent the parent widget
%End

static QgsSymbolLayerWidget *create( const QgsVectorLayer *layer ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *layer ) /Factory/;
%Docstring
Static creation method
\param layer the layer where this symbol layer is applied
@@ -15,9 +15,9 @@ class QgsEllipseSymbolLayerWidget: QgsSymbolLayerWidget
#include "qgsellipsesymbollayerwidget.h"
%End
public:
QgsEllipseSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsEllipseSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -18,7 +18,7 @@ class QgsLayerPropertiesWidget : QgsPanelWidget, QgsExpressionContextGenerator
#include "qgslayerpropertieswidget.h"
%End
public:
QgsLayerPropertiesWidget( QgsSymbolLayer *layer, const QgsSymbol *symbol, const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsLayerPropertiesWidget( QgsSymbolLayer *layer, const QgsSymbol *symbol, QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

void setContext( const QgsSymbolWidgetContext &context );
%Docstring
@@ -16,7 +16,7 @@ class QgsSymbolLayerWidget : QWidget, protected QgsExpressionContextGenerator
#include "qgssymbollayerwidget.h"
%End
public:
QgsSymbolLayerWidget( QWidget *parent /TransferThis/, const QgsVectorLayer *vl = 0 );
QgsSymbolLayerWidget( QWidget *parent /TransferThis/, QgsVectorLayer *vl = 0 );

virtual void setSymbolLayer( QgsSymbolLayer *layer ) = 0;
virtual QgsSymbolLayer *symbolLayer() = 0;
@@ -79,6 +79,8 @@ class QgsSymbolLayerWidget : QWidget, protected QgsExpressionContextGenerator
protected slots:
void updateDataDefinedProperty();

void createAuxiliaryField();

};


@@ -91,9 +93,9 @@ class QgsSimpleLineSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsSimpleLineSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -117,9 +119,9 @@ class QgsSimpleMarkerSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsSimpleMarkerSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -146,9 +148,9 @@ class QgsSimpleFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsSimpleFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -180,14 +182,14 @@ class QgsFilledMarkerSymbolLayerWidget : QgsSymbolLayerWidget
%End
public:

QgsFilledMarkerSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsFilledMarkerSymbolLayerWidget.
\param vl associated vector layer
\param parent parent widget
%End

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
Creates a new QgsFilledMarkerSymbolLayerWidget.
\param vl associated vector layer
@@ -211,9 +213,9 @@ class QgsGradientFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsGradientFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -247,9 +249,9 @@ class QgsShapeburstFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsShapeburstFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsShapeburstFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -275,9 +277,9 @@ class QgsMarkerLineSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsMarkerLineSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -306,9 +308,9 @@ class QgsSvgMarkerSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsSvgMarkerSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -334,9 +336,9 @@ class QgsRasterFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsRasterFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -358,9 +360,9 @@ class QgsSVGFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsSVGFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -392,8 +394,8 @@ class QgsLinePatternFillSymbolLayerWidget : QgsSymbolLayerWidget
%End
public:

QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
QgsLinePatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -415,8 +417,8 @@ class QgsPointPatternFillSymbolLayerWidget: QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
QgsPointPatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -438,9 +440,9 @@ class QgsFontMarkerSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsFontMarkerSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -476,9 +478,9 @@ class QgsCentroidFillSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsCentroidFillSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -500,9 +502,9 @@ class QgsGeometryGeneratorSymbolLayerWidget : QgsSymbolLayerWidget
#include "qgssymbollayerwidget.h"
%End
public:
QgsGeometryGeneratorSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsGeometryGeneratorSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
Will be registered as factory
:rtype: QgsSymbolLayerWidget
@@ -28,7 +28,7 @@ class QgsSymbolSelectorWidget: QgsPanelWidget
%End
public:

QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *style, const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
%Docstring
Symbol selector widget that can be used to select and build a symbol
\param symbol The symbol to load into the widget as a start point.
@@ -184,7 +184,7 @@ class QgsSymbolSelectorDialog : QDialog
#include "qgssymbolselectordialog.h"
%End
public:
QgsSymbolSelectorDialog( QgsSymbol *symbol, QgsStyle *style, const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0, bool embedded = false );
QgsSymbolSelectorDialog( QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0, bool embedded = false );
~QgsSymbolSelectorDialog();

QMenu *advancedMenu();
@@ -15,9 +15,9 @@ class QgsVectorFieldSymbolLayerWidget: QgsSymbolLayerWidget
#include "qgsvectorfieldsymbollayerwidget.h"
%End
public:
QgsVectorFieldSymbolLayerWidget( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );
QgsVectorFieldSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0 );

static QgsSymbolLayerWidget *create( const QgsVectorLayer *vl ) /Factory/;
static QgsSymbolLayerWidget *create( QgsVectorLayer *vl ) /Factory/;
%Docstring
:rtype: QgsSymbolLayerWidget
%End
@@ -181,7 +181,6 @@ SET(QGIS_APP_SRCS
pluginmanager/qgspluginitemdelegate.cpp

qgsnewspatialitelayerdialog.cpp
qgsnewauxiliarylayerdialog.cpp

qgssettingstree.cpp
qgsvariantdelegate.cpp
@@ -360,7 +359,6 @@ SET (QGIS_APP_MOC_HDRS
pluginmanager/qgspluginitemdelegate.h

qgsnewspatialitelayerdialog.h
qgsnewauxiliarylayerdialog.h

qgssettingstree.h
qgsvariantdelegate.h
@@ -1407,6 +1407,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
mRendererDialog->setMapCanvas( QgisApp::instance()->mapCanvas() );
connect( mRendererDialog, &QgsRendererPropertiesDialog::showPanel, this, &QgsVectorLayerProperties::openPanel );
connect( mRendererDialog, &QgsRendererPropertiesDialog::layerVariablesChanged, this, &QgsVectorLayerProperties::updateVariableEditor );
connect( mRendererDialog, &QgsRendererPropertiesDialog::widgetChanged, this, [ = ] { updateAuxiliaryStoragePage(); } );

// display the menu to choose the output format (fix #5136)
mActionSaveStyleAs->setText( tr( "Save Style" ) );
@@ -22,6 +22,7 @@
#include "qgsvectorlayerlabeling.h"
#include "qgsdiagramrenderer.h"
#include "qgsmemoryproviderutils.h"
#include "qgssymbollayer.h"

#include <QFile>

@@ -59,6 +60,18 @@ QgsAuxiliaryField::QgsAuxiliaryField( const QgsField &f )
}
}
}
else if ( origin.compare( "symbol", Qt::CaseInsensitive ) == 0 )
{
const QgsPropertiesDefinition props = QgsSymbolLayer::propertyDefinitions();
Q_FOREACH ( const QgsPropertyDefinition p, props.values() )
{
if ( p.name().compare( propertyName, Qt::CaseInsensitive ) == 0 )
{
def = p;
break;
}
}
}
else if ( origin.compare( "diagram", Qt::CaseInsensitive ) == 0 )
{
const QgsPropertiesDefinition props = QgsDiagramLayerSettings::propertyDefinitions();

0 comments on commit df02157

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