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()
101 if ( mDDSize && ( mSize != mMarkerSymbolLayer->size() || mMarkerOffset != mMarkerSymbolLayer->offset() ) )
102 mMarker->setDataDefinedSize( mDDSize );
103 if ( mDDAngle && mAngle != mMarkerSymbolLayer->angle() )
104 mMarker->setDataDefinedAngle( mDDAngle );
108 if ( mDDWidth && ( mWidth != mLineSymbolLayer->width() || mLineOffset != mLineSymbolLayer->offset() ) )
109 mLine->setDataDefinedWidth( mDDWidth );
116class SymbolLayerItem :
public QStandardItem
120 : mVectorLayer( vectorLayer )
123 setLayer( layer, symbolType );
127 : mVectorLayer( vectorLayer )
138 mSymbolType = symbolType;
152 if ( !mSize.isValid() )
155 mSize = QSize( size, size );
168 if (
auto *lParent = parent() )
169 static_cast<SymbolLayerItem *
>( lParent )->updatePreview();
172 int type()
const override {
return SYMBOL_LAYER_ITEM_TYPE; }
173 bool isLayer() {
return mIsLayer; }
186 QVariant data(
int role )
const override
188 if ( role == Qt::DisplayRole || role == Qt::EditRole )
200 switch ( mSymbol->type() )
203 return QCoreApplication::translate(
"SymbolLayerItem",
"Marker" );
205 return QCoreApplication::translate(
"SymbolLayerItem",
"Fill" );
207 return QCoreApplication::translate(
"SymbolLayerItem",
"Line" );
213 else if ( role == Qt::ForegroundRole && mIsLayer )
215 if ( !mLayer->enabled() )
217 QPalette
pal = qApp->palette();
218 QBrush brush = QStandardItem::data( role ).value<QBrush>();
219 brush.setColor(
pal.color( QPalette::Disabled, QPalette::WindowText ) );
230 if ( role == Qt::CheckStateRole )
232 return QStandardItem::data( role );
238 QPointer<QgsVectorLayer> mVectorLayer;
239 bool mIsLayer =
false;
242 QPointer<QScreen> mScreen;
256 setWindowModality( Qt::WindowModal );
260 this->layout()->setContentsMargins( 0, 0, 0, 0 );
262 layersTree->setMaximumHeight(
static_cast<int>(
Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 7 ) );
263 layersTree->setMinimumHeight( layersTree->maximumHeight() );
264 lblPreview->setMaximumWidth( layersTree->maximumHeight() );
272 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
273 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
276 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
277 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
278 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
279 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
281 mLockColorAction =
new QAction( tr(
"Lock Color" ),
this );
282 mLockColorAction->setToolTip( tr(
"Avoid changing the color of the layer when the symbol color is changed" ) );
283 mLockColorAction->setCheckable(
true );
284 mLockColorAction->setIcon( iconColorLock );
286 QIcon iconSelectLock;
287 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
288 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
289 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
290 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
292 mLockSelectionColorAction =
new QAction( tr(
"Lock Color When Selected" ),
this );
293 mLockSelectionColorAction->setToolTip( tr(
"Avoid changing the color of the layer when a feature is selected" ) );
294 mLockSelectionColorAction->setCheckable(
true );
295 mLockSelectionColorAction->setIcon( iconSelectLock );
297 QMenu *lockMenu =
new QMenu(
this );
298 lockMenu->addAction( mLockColorAction );
299 lockMenu->addAction( mLockSelectionColorAction );
300 btnLock->setMenu( lockMenu );
301 btnLock->setPopupMode( QToolButton::InstantPopup );
307 mSymbolLayersModel =
new QStandardItemModel( layersTree );
309 layersTree->setModel( mSymbolLayersModel );
310 layersTree->setHeaderHidden(
true );
322 mPreviewExpressionContext.
setFeature( mPreviewFeature );
330 QItemSelectionModel *selModel = layersTree->selectionModel();
333 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
341 connect( mLockSelectionColorAction, &QAction::toggled,
this, [=](
bool checked ) {
349 updateLockButtonIcon();
355 updateLockButtonIcon();
360 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
361 layersTree->setCurrentIndex( newIndex );
390 widget->mOwnedSymbol = std::move(
symbol );
396 if ( !mAdvancedMenu )
398 mAdvancedMenu =
new QMenu(
this );
402 return mAdvancedMenu;
411 mPreviewExpressionContext = *lExpressionContext;
415 mPreviewExpressionContext.
setFeature( mPreviewFeature );
418 QWidget *widget = stackedWidget->currentWidget();
420 layerProp->setContext(
context );
422 listWidget->setContext(
context );
441 mSymbolLayersModel->clear();
442 parent =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() );
445 SymbolLayerItem *symbolItem =
new SymbolLayerItem(
symbol, mVectorLayer, screen() );
446 QFont boldFont = symbolItem->font();
447 boldFont.setBold(
true );
448 symbolItem->setFont( boldFont );
449 parent->appendRow( symbolItem );
452 for (
int i = count - 1; i >= 0; i-- )
455 layerItem->setEditable(
false );
456 symbolItem->appendRow( layerItem );
461 layersTree->setExpanded( layerItem->index(),
true );
463 layersTree->setExpanded( symbolItem->index(),
true );
465 if ( mSymbol ==
symbol && !layersTree->currentIndex().isValid() )
468 layersTree->setCurrentIndex( symbolItem->index() );
472void QgsSymbolSelectorWidget::reloadSymbol()
474 mSymbolLayersModel->clear();
475 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
478void QgsSymbolSelectorWidget::updateUi()
480 const QModelIndex currentIdx = layersTree->currentIndex();
481 if ( !currentIdx.isValid() )
484 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( currentIdx ) );
485 if ( !item->isLayer() )
487 btnUp->setEnabled(
false );
488 btnDown->setEnabled(
false );
489 btnRemoveLayer->setEnabled(
false );
490 btnLock->setEnabled(
false );
491 btnDuplicate->setEnabled(
false );
495 const int rowCount = item->parent()->rowCount();
496 const int currentRow = item->row();
498 btnUp->setEnabled( currentRow > 0 );
499 btnDown->setEnabled( currentRow < rowCount - 1 );
500 btnRemoveLayer->setEnabled( rowCount > 1 );
501 btnLock->setEnabled(
true );
502 btnDuplicate->setEnabled(
true );
510 std::unique_ptr<QgsSymbol> symbolClone( mSymbol->
clone() );
512 lblPreview->setPixmap( QPixmap::fromImage( preview ) );
514 if ( !mBlockModified )
521 SymbolLayerItem *item = currentLayerItem();
523 item->updatePreview();
528SymbolLayerItem *QgsSymbolSelectorWidget::currentLayerItem()
530 const QModelIndex idx = layersTree->currentIndex();
531 if ( !idx.isValid() )
534 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
535 if ( !item->isLayer() )
543 const QModelIndex idx = layersTree->currentIndex();
544 if ( !idx.isValid() )
547 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
548 if ( item->isLayer() )
549 return item->layer();
558 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
562 if ( currentItem->isLayer() )
564 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
565 mDataDefineRestorer.reset(
new DataDefinedRestorer( parent->symbol(), currentItem->layer() ) );
569 setWidget( layerProp );
580 mDataDefineRestorer.reset();
582 currentItem->symbol()->setLayer( mVectorLayer );
586 symbolsList->setContext( mContext );
588 setWidget( symbolsList );
596 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
597 if ( !currentItem || currentItem->isLayer() )
601 if ( currentItem->parent() )
605 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
606 parent->removeRow( 0 );
608 layersTree->setCurrentIndex( parent->child( 0 )->index() );
609 parent->updatePreview();
615 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
616 layersTree->setCurrentIndex( newIndex );
623void QgsSymbolSelectorWidget::setWidget( QWidget *widget )
625 const int index = stackedWidget->addWidget( widget );
626 stackedWidget->setCurrentIndex( index );
627 if ( mPresentWidget )
628 mPresentWidget->deleteLater();
629 mPresentWidget = widget;
632void QgsSymbolSelectorWidget::updateLockButton()
637 mLockColorAction->setChecked( layer->
isLocked() );
640 updateLockButtonIcon();
643void QgsSymbolSelectorWidget::updateLockButtonIcon()
645 if ( mLockColorAction->isChecked() && mLockSelectionColorAction->isChecked() )
647 else if ( mLockColorAction->isChecked() )
649 else if ( mLockSelectionColorAction->isChecked() )
657 const QModelIndex idx = layersTree->currentIndex();
658 if ( !idx.isValid() )
662 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
663 if ( item->isLayer() )
665 insertIdx = item->row();
666 item =
static_cast<SymbolLayerItem *
>( item->parent() );
669 QgsSymbol *parentSymbol = item->symbol();
677 if ( insertIdx == -1 )
684 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedSize( ddSize );
686 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedAngle( ddAngle );
688 static_cast<QgsLineSymbol *
>( parentSymbol )->setDataDefinedWidth( ddWidth );
690 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
691 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
692 item->updatePreview();
694 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
701 SymbolLayerItem *item = currentLayerItem();
702 const int row = item->row();
703 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
705 const int layerIdx = parent->rowCount() - row - 1;
706 QgsSymbol *parentSymbol = parent->symbol();
709 parent->removeRow( row );
710 parent->updatePreview();
712 const QModelIndex newIdx = parent->child( 0 )->index();
713 layersTree->setCurrentIndex( newIdx );
723 moveLayerByOffset( +1 );
728 moveLayerByOffset( -1 );
731void QgsSymbolSelectorWidget::moveLayerByOffset(
int offset )
733 SymbolLayerItem *item = currentLayerItem();
736 const int row = item->row();
738 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
739 QgsSymbol *parentSymbol = parent->symbol();
741 const int layerIdx = parent->rowCount() - row - 1;
746 QList<QStandardItem *> rowItems = parent->takeRow( row );
747 parent->insertRows( row + offset, rowItems );
748 parent->updatePreview();
750 const QModelIndex newIdx = rowItems[0]->index();
751 layersTree->setCurrentIndex( newIdx );
762 layer->
setLocked( mLockColorAction->isChecked() );
763 updateLockButtonIcon();
769 const QModelIndex idx = layersTree->currentIndex();
770 if ( !idx.isValid() )
773 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
774 if ( !item->isLayer() )
779 const int insertIdx = item->row();
780 item =
static_cast<SymbolLayerItem *
>( item->parent() );
782 QgsSymbol *parentSymbol = item->symbol();
786 if ( insertIdx == -1 )
791 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
792 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
796 layersTree->setExpanded( newLayerItem->index(),
true );
798 item->updatePreview();
800 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
807 SymbolLayerItem *item = currentLayerItem();
809 if ( item->rowCount() > 0 )
811 item->removeRow( 0 );
821 layersTree->setExpanded( item->index(),
true );
825 const int layerIdx = item->parent()->rowCount() - item->row() - 1;
828 item->updatePreview();
837 setLayout(
new QVBoxLayout() );
840 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
842 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
843 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
844 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsSymbolSelectorDialog::showHelp );
846 layout()->addWidget( mSelectorWidget );
847 layout()->addWidget( mButtonBox );
851 mSelectorWidget->setMinimumSize( 460, 560 );
852 setObjectName( QStringLiteral(
"SymbolSelectorDialog" ) );
859 layout()->setContentsMargins( 0, 0, 0, 0 );
863 setWindowTitle( tr(
"Symbol Selector" ) );
885 return mSelectorWidget->
symbol();
891 if ( !isWindow() && e->key() == Qt::Key_Escape )
897 QDialog::keyPressEvent( e );
901void QgsSymbolSelectorDialog::reloadSymbol()
903 mSelectorWidget->reloadSymbol();
911void QgsSymbolSelectorDialog::updateUi()
913 mSelectorWidget->updateUi();
916void QgsSymbolSelectorDialog::updateLockButton()
918 mSelectorWidget->updateLockButton();
921SymbolLayerItem *QgsSymbolSelectorDialog::currentLayerItem()
923 return mSelectorWidget->currentLayerItem();
928 return mSelectorWidget->currentLayer();
931void QgsSymbolSelectorDialog::moveLayerByOffset(
int offset )
933 mSelectorWidget->moveLayerByOffset( offset );
936void QgsSymbolSelectorDialog::setWidget( QWidget *widget )
938 mSelectorWidget->setWidget( widget );
1001void QgsSymbolSelectorDialog::showHelp()
1006void QgsSymbolSelectorWidget::projectDataChanged()
1008 mBlockModified =
true;
1011 mBlockModified =
false;
1014void QgsSymbolSelectorWidget::layersAboutToBeRemoved(
const QList<QgsMapLayer *> &layers )
1016 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