17#include "moc_qgssymbolselectordialog.cpp"
40#include <QColorDialog>
42#include <QStandardItemModel>
43#include <QInputDialog>
50#include <QStandardItem>
54static const int SYMBOL_LAYER_ITEM_TYPE = QStandardItem::UserType + 1;
64 mDDSize = mMarker->dataDefinedSize();
65 mDDAngle = mMarker->dataDefinedAngle();
67 if ( !mDDSize && !mDDAngle )
74 mDDWidth = mLine->dataDefinedWidth();
82void DataDefinedRestorer::save()
86 mSize = mMarkerSymbolLayer->size();
87 mAngle = mMarkerSymbolLayer->angle();
88 mMarkerOffset = mMarkerSymbolLayer->offset();
92 mWidth = mLineSymbolLayer->width();
93 mLineOffset = mLineSymbolLayer->offset();
97void DataDefinedRestorer::restore()
102 ( mSize != mMarkerSymbolLayer->size() || mMarkerOffset != mMarkerSymbolLayer->offset() ) )
103 mMarker->setDataDefinedSize( mDDSize );
105 mAngle != mMarkerSymbolLayer->angle() )
106 mMarker->setDataDefinedAngle( mDDAngle );
111 ( mWidth != mLineSymbolLayer->width() || mLineOffset != mLineSymbolLayer->offset() ) )
112 mLine->setDataDefinedWidth( mDDWidth );
119class SymbolLayerItem :
public QStandardItem
123 : mVectorLayer( vectorLayer )
126 setLayer( layer, symbolType );
130 : mVectorLayer( vectorLayer )
141 mSymbolType = symbolType;
155 if ( !mSize.isValid() )
158 mSize = QSize( size, size );
171 if (
auto *lParent = parent() )
172 static_cast<SymbolLayerItem *
>( lParent )->updatePreview();
175 int type()
const override {
return SYMBOL_LAYER_ITEM_TYPE; }
176 bool isLayer() {
return mIsLayer; }
189 QVariant data(
int role )
const override
191 if ( role == Qt::DisplayRole || role == Qt::EditRole )
203 switch ( mSymbol->type() )
206 return QCoreApplication::translate(
"SymbolLayerItem",
"Marker" );
208 return QCoreApplication::translate(
"SymbolLayerItem",
"Fill" );
210 return QCoreApplication::translate(
"SymbolLayerItem",
"Line" );
216 else if ( role == Qt::ForegroundRole && mIsLayer )
218 if ( !mLayer->enabled() )
220 QPalette
pal = qApp->palette();
221 QBrush brush = QStandardItem::data( role ).value< QBrush >();
222 brush.setColor(
pal.color( QPalette::Disabled, QPalette::WindowText ) );
233 if ( role == Qt::CheckStateRole )
235 return QStandardItem::data( role );
241 QPointer< QgsVectorLayer > mVectorLayer;
242 bool mIsLayer =
false;
245 QPointer< QScreen > mScreen;
259 setWindowModality( Qt::WindowModal );
263 this->layout()->setContentsMargins( 0, 0, 0, 0 );
265 layersTree->setMaximumHeight(
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 7 ) );
266 layersTree->setMinimumHeight( layersTree->maximumHeight() );
267 lblPreview->setMaximumWidth( layersTree->maximumHeight() );
275 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
276 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
279 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
280 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
281 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
282 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
284 mLockColorAction =
new QAction( tr(
"Lock Color" ),
this );
285 mLockColorAction->setToolTip( tr(
"Avoid changing the color of the layer when the symbol color is changed" ) );
286 mLockColorAction->setCheckable(
true );
287 mLockColorAction->setIcon( iconColorLock );
289 QIcon iconSelectLock;
290 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
291 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
292 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
293 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
295 mLockSelectionColorAction =
new QAction( tr(
"Lock Color When Selected" ),
this );
296 mLockSelectionColorAction->setToolTip( tr(
"Avoid changing the color of the layer when a feature is selected" ) );
297 mLockSelectionColorAction->setCheckable(
true );
298 mLockSelectionColorAction->setIcon( iconSelectLock );
300 QMenu *lockMenu =
new QMenu(
this );
301 lockMenu->addAction( mLockColorAction );
302 lockMenu->addAction( mLockSelectionColorAction );
303 btnLock->setMenu( lockMenu );
304 btnLock->setPopupMode( QToolButton::InstantPopup );
310 mSymbolLayersModel =
new QStandardItemModel( layersTree );
312 layersTree->setModel( mSymbolLayersModel );
313 layersTree->setHeaderHidden(
true );
325 mPreviewExpressionContext.
setFeature( mPreviewFeature );
333 QItemSelectionModel *selModel = layersTree->selectionModel();
336 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
344 connect( mLockSelectionColorAction, &QAction::toggled,
this, [ = ](
bool checked )
353 updateLockButtonIcon();
359 updateLockButtonIcon();
364 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
365 layersTree->setCurrentIndex( newIndex );
394 widget->mOwnedSymbol = std::move(
symbol );
400 if ( !mAdvancedMenu )
402 mAdvancedMenu =
new QMenu(
this );
406 return mAdvancedMenu;
415 mPreviewExpressionContext = *lExpressionContext;
419 mPreviewExpressionContext.
setFeature( mPreviewFeature );
422 QWidget *widget = stackedWidget->currentWidget();
424 layerProp->setContext(
context );
426 listWidget->setContext(
context );
445 mSymbolLayersModel->clear();
446 parent =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() );
449 SymbolLayerItem *symbolItem =
new SymbolLayerItem(
symbol, mVectorLayer, screen() );
450 QFont boldFont = symbolItem->font();
451 boldFont.setBold(
true );
452 symbolItem->setFont( boldFont );
453 parent->appendRow( symbolItem );
456 for (
int i = count - 1; i >= 0; i-- )
459 layerItem->setEditable(
false );
460 symbolItem->appendRow( layerItem );
465 layersTree->setExpanded( layerItem->index(),
true );
467 layersTree->setExpanded( symbolItem->index(),
true );
469 if ( mSymbol ==
symbol && !layersTree->currentIndex().isValid() )
472 layersTree->setCurrentIndex( symbolItem->index() );
476void QgsSymbolSelectorWidget::reloadSymbol()
478 mSymbolLayersModel->clear();
479 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
482void QgsSymbolSelectorWidget::updateUi()
484 const QModelIndex currentIdx = layersTree->currentIndex();
485 if ( !currentIdx.isValid() )
488 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( currentIdx ) );
489 if ( !item->isLayer() )
491 btnUp->setEnabled(
false );
492 btnDown->setEnabled(
false );
493 btnRemoveLayer->setEnabled(
false );
494 btnLock->setEnabled(
false );
495 btnDuplicate->setEnabled(
false );
499 const int rowCount = item->parent()->rowCount();
500 const int currentRow = item->row();
502 btnUp->setEnabled( currentRow > 0 );
503 btnDown->setEnabled( currentRow < rowCount - 1 );
504 btnRemoveLayer->setEnabled( rowCount > 1 );
505 btnLock->setEnabled(
true );
506 btnDuplicate->setEnabled(
true );
514 std::unique_ptr< QgsSymbol > symbolClone( mSymbol->
clone() );
516 lblPreview->setPixmap( QPixmap::fromImage( preview ) );
518 if ( !mBlockModified )
525 SymbolLayerItem *item = currentLayerItem();
527 item->updatePreview();
532SymbolLayerItem *QgsSymbolSelectorWidget::currentLayerItem()
534 const QModelIndex idx = layersTree->currentIndex();
535 if ( !idx.isValid() )
538 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
539 if ( !item->isLayer() )
547 const QModelIndex idx = layersTree->currentIndex();
548 if ( !idx.isValid() )
551 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
552 if ( item->isLayer() )
553 return item->layer();
562 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
566 if ( currentItem->isLayer() )
568 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
569 mDataDefineRestorer.reset(
new DataDefinedRestorer( parent->symbol(), currentItem->layer() ) );
573 setWidget( layerProp );
584 mDataDefineRestorer.reset();
586 currentItem->symbol()->setLayer( mVectorLayer );
590 symbolsList->setContext( mContext );
592 setWidget( symbolsList );
600 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
601 if ( !currentItem || currentItem->isLayer() )
605 if ( currentItem->parent() )
609 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
610 parent->removeRow( 0 );
612 layersTree->setCurrentIndex( parent->child( 0 )->index() );
613 parent->updatePreview();
619 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
620 layersTree->setCurrentIndex( newIndex );
627void QgsSymbolSelectorWidget::setWidget( QWidget *widget )
629 const int index = stackedWidget->addWidget( widget );
630 stackedWidget->setCurrentIndex( index );
631 if ( mPresentWidget )
632 mPresentWidget->deleteLater();
633 mPresentWidget = widget;
636void QgsSymbolSelectorWidget::updateLockButton()
641 mLockColorAction->setChecked( layer->
isLocked() );
644 updateLockButtonIcon();
647void QgsSymbolSelectorWidget::updateLockButtonIcon()
649 if ( mLockColorAction->isChecked() && mLockSelectionColorAction->isChecked() )
651 else if ( mLockColorAction->isChecked() )
653 else if ( mLockSelectionColorAction->isChecked() )
661 const QModelIndex idx = layersTree->currentIndex();
662 if ( !idx.isValid() )
666 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
667 if ( item->isLayer() )
669 insertIdx = item->row();
670 item =
static_cast<SymbolLayerItem *
>( item->parent() );
673 QgsSymbol *parentSymbol = item->symbol();
687 if ( insertIdx == -1 )
694 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedSize( ddSize );
696 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedAngle( ddAngle );
698 static_cast<QgsLineSymbol *
>( parentSymbol )->setDataDefinedWidth( ddWidth );
700 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
701 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
702 item->updatePreview();
704 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
711 SymbolLayerItem *item = currentLayerItem();
712 const int row = item->row();
713 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
715 const int layerIdx = parent->rowCount() - row - 1;
716 QgsSymbol *parentSymbol = parent->symbol();
719 parent->removeRow( row );
720 parent->updatePreview();
722 const QModelIndex newIdx = parent->child( 0 )->index();
723 layersTree->setCurrentIndex( newIdx );
733 moveLayerByOffset( + 1 );
738 moveLayerByOffset( -1 );
741void QgsSymbolSelectorWidget::moveLayerByOffset(
int offset )
743 SymbolLayerItem *item = currentLayerItem();
746 const int row = item->row();
748 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
749 QgsSymbol *parentSymbol = parent->symbol();
751 const int layerIdx = parent->rowCount() - row - 1;
756 QList<QStandardItem *> rowItems = parent->takeRow( row );
757 parent->insertRows( row + offset, rowItems );
758 parent->updatePreview();
760 const QModelIndex newIdx = rowItems[ 0 ]->index();
761 layersTree->setCurrentIndex( newIdx );
772 layer->
setLocked( mLockColorAction->isChecked() );
773 updateLockButtonIcon();
779 const QModelIndex idx = layersTree->currentIndex();
780 if ( !idx.isValid() )
783 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
784 if ( !item->isLayer() )
789 const int insertIdx = item->row();
790 item =
static_cast<SymbolLayerItem *
>( item->parent() );
792 QgsSymbol *parentSymbol = item->symbol();
796 if ( insertIdx == -1 )
801 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
802 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
806 layersTree->setExpanded( newLayerItem->index(),
true );
808 item->updatePreview();
810 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
817 SymbolLayerItem *item = currentLayerItem();
819 if ( item->rowCount() > 0 )
821 item->removeRow( 0 );
831 layersTree->setExpanded( item->index(),
true );
835 const int layerIdx = item->parent()->rowCount() - item->row() - 1;
838 item->updatePreview();
847 setLayout(
new QVBoxLayout() );
850 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
852 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
853 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
854 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsSymbolSelectorDialog::showHelp );
856 layout()->addWidget( mSelectorWidget );
857 layout()->addWidget( mButtonBox );
861 mSelectorWidget->setMinimumSize( 460, 560 );
862 setObjectName( QStringLiteral(
"SymbolSelectorDialog" ) );
869 layout()->setContentsMargins( 0, 0, 0, 0 );
873 setWindowTitle( tr(
"Symbol Selector" ) );
895 return mSelectorWidget->
symbol();
901 if ( !isWindow() && e->key() == Qt::Key_Escape )
907 QDialog::keyPressEvent( e );
911void QgsSymbolSelectorDialog::reloadSymbol()
913 mSelectorWidget->reloadSymbol();
921void QgsSymbolSelectorDialog::updateUi()
923 mSelectorWidget->updateUi();
926void QgsSymbolSelectorDialog::updateLockButton()
928 mSelectorWidget->updateLockButton();
931SymbolLayerItem *QgsSymbolSelectorDialog::currentLayerItem()
933 return mSelectorWidget->currentLayerItem();
938 return mSelectorWidget->currentLayer();
941void QgsSymbolSelectorDialog::moveLayerByOffset(
int offset )
943 mSelectorWidget->moveLayerByOffset( offset );
946void QgsSymbolSelectorDialog::setWidget( QWidget *widget )
948 mSelectorWidget->setWidget( widget );
1011void QgsSymbolSelectorDialog::showHelp()
1016void QgsSymbolSelectorWidget::projectDataChanged()
1018 mBlockModified =
true;
1021 mBlockModified =
false;
1024void QgsSymbolSelectorWidget::layersAboutToBeRemoved(
const QList<QgsMapLayer *> &layers )
1026 if ( mVectorLayer && layers.contains( mVectorLayer ) )
QFlags< SymbolLayerUserFlag > SymbolLayerUserFlags
Symbol layer user flags.
@ Millimeters
Millimeters.
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
@ DisableSelectionRecoloring
If present, indicates that the symbol layer should not be recolored when rendering selected features.
static const double UI_SCALE_FACTOR
UI scaling factor.
static QgsSymbolLayerRegistry * symbolLayerRegistry()
Returns the application's symbol layer registry, used for managing symbol layers.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QgsImageCache * imageCache()
Returns the application's image cache, used for caching resampled versions of raster images.
static QgsSvgCache * svgCache()
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement w...
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer's project and layer.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
void appendScopes(const QList< QgsExpressionContextScope * > &scopes)
Appends a list of scopes to the end of the context.
Wrapper for iterator of features from vector data provider or vector layer.
bool nextFeature(QgsFeature &f)
Fetch next feature and stores in f, returns true on success.
This class wraps a request for features to a vector layer (or directly its vector data provider).
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
void remoteImageFetched(const QString &url)
Emitted when the cache has finished retrieving an image file from a remote url.
Abstract base class for line symbol layers.
A line symbol type, for rendering LineString and MultiLineString geometries.
QgsProperty dataDefinedWidth() const
Returns data defined width for whole symbol (including all symbol layers).
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
A marker symbol type, for rendering Point and MultiPoint geometries.
QgsProperty dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
QgsProperty dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
static QgsProject * instance()
Returns the QgsProject singleton instance.
void layersWillBeRemoved(const QStringList &layerIds)
Emitted when one or more layers are about to be removed from the registry.
void projectColorsChanged()
Emitted whenever the project's color scheme has been changed.
A store for object properties.
Stores properties relating to a screen.
void remoteSvgFetched(const QString &url)
Emitted when the cache has finished retrieving an SVG file from a remote url.
QgsSymbolLayerAbstractMetadata * symbolLayerMetadata(const QString &name) const
Returns metadata for specified symbol layer. Returns nullptr if not found.
static QgsSymbolLayer * defaultSymbolLayer(Qgis::SymbolType type)
create a new instance of symbol layer for specified symbol type with default settings
static QIcon symbolLayerPreviewIcon(const QgsSymbolLayer *layer, Qgis::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid, QgsMapLayer *mapLayer=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Draws a symbol layer preview to an icon.
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Returns a pixmap preview for a color ramp.
static void resetSymbolLayerIds(QgsSymbol *symbol)
Regenerate recursively unique id from all symbol symbol layers.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qgis::SymbolType type() const
bool isLocked() const
Returns true if the symbol layer colors are locked and the layer will ignore any symbol-level color c...
void setUserFlags(Qgis::SymbolLayerUserFlags flags)
Sets user-controlled flags which control the symbol layer's behavior.
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Qgis::SymbolLayerUserFlags userFlags() const
Returns user-controlled flags which control the symbol layer's behavior.
void setLocked(bool locked)
Sets whether the layer's colors are locked.
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
QgsSymbolSelectorDialog(QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent=nullptr, bool embedded=false)
Constructor for QgsSymbolSelectorDialog.
QgsSymbolWidgetContext context() const
Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expressi...
QMenu * advancedMenu()
Returns menu for "advanced" button - create it if doesn't exist and show the advanced button.
void symbolChanged()
Slot to update tree when a new symbol from style.
QDialogButtonBox * buttonBox() const
Returns a reference to the dialog's button box.
QgsSymbol * symbol()
Returns the symbol that is currently active in the widget.
void keyPressEvent(QKeyEvent *e) override
void updateLayerPreview()
void duplicateLayer()
Duplicates the current symbol layer and places the duplicated layer above the current symbol layer.
void changeLayer(QgsSymbolLayer *layer)
Alters tree and sets proper widget when Layer Type is changed.
void loadSymbol(QgsSymbol *symbol, SymbolLayerItem *parent=nullptr)
Loads the given symbol into the widget.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
Abstract base class for all rendered symbols.
QgsSymbolLayer * symbolLayer(int layer)
Returns the symbol layer at the specified index.
bool appendSymbolLayer(QgsSymbolLayer *layer)
Appends a symbol layer at the end of the current symbol layer list.
bool insertSymbolLayer(int index, QgsSymbolLayer *layer)
Inserts a symbol layer to specified index.
bool changeSymbolLayer(int index, QgsSymbolLayer *layer)
Deletes the current layer at the specified index and replaces it with layer.
QgsSymbolLayer * takeSymbolLayer(int index)
Removes a symbol layer from the list and returns a pointer to it.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Qgis::SymbolType type() const
Returns the symbol's type.
Represents a vector layer which manages a vector based data sets.
int scaleIconSize(int standardSize)
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly,...
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH