19 #include <QStandardItem> 21 #include <QMessageBox> 42 if ( !abstractMetadata )
44 QgsDebugMsg(
"Failed to find symbol layer's entry in registry: " + name );
50 QgsDebugMsg(
"Failed to cast symbol layer's metadata: " + name );
59 static bool initialized =
false;
91 , mPresetExpressionContext( nullptr )
92 , mMapCanvas( nullptr )
117 cboLayerType->setCurrentIndex( idx );
140 mEffectWidget->setDockMode( this->
dockMode() );
145 mPresetExpressionContext = context;
156 Q_FOREACH (
const QString& symbolLayerId, symbolLayerIds )
162 Q_FOREACH (
const QString& lineLayerId, lineLayerIds )
169 cboLayerType->addItem( name, lineLayerId );
177 if ( stackedWidget->currentWidget() != pageDummy )
181 stackedWidget->removeWidget( stackedWidget->currentWidget() );
197 stackedWidget->addWidget( w );
198 stackedWidget->setCurrentWidget( w );
201 connect( w, SIGNAL( symbolChanged() ),
this, SLOT( reloadLayer() ) );
206 stackedWidget->setCurrentWidget( pageDummy );
214 QString newLayerType = cboLayerType->itemData( cboLayerType->currentIndex() ).toString();
215 if ( layer->
layerType() == newLayerType )
243 void QgsLayerPropertiesWidget::reloadLayer()
QgsSymbolLayerV2AbstractMetadata * symbolLayerMetadata(const QString &name) const
return metadata for specified symbol layer. Returns NULL if not found
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
static QgsSymbolLayerV2Registry * instance()
return the single instance of this class (instantiate it if not exists)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
const char * name() const
The output shall be in millimeters.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsSymbolLayerV2Widget *(* QgsSymbolLayerV2WidgetFunc)(const QgsVectorLayer *)
QStringList symbolLayersForType(QgsSymbolV2::SymbolType type)
return a list of available symbol layers for a specified symbol type
static QPicture symbolLayerPreviewPicture(QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit units, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
Draws a symbol layer preview to a QPicture.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
Registry of available symbol layer classes.