39#include <QColorDialog>
41#include <QStandardItemModel>
42#include <QInputDialog>
49#include <QStandardItem>
53static const int SYMBOL_LAYER_ITEM_TYPE = QStandardItem::UserType + 1;
63 mDDSize = mMarker->dataDefinedSize();
64 mDDAngle = mMarker->dataDefinedAngle();
66 if ( !mDDSize && !mDDAngle )
73 mDDWidth = mLine->dataDefinedWidth();
81void DataDefinedRestorer::save()
85 mSize = mMarkerSymbolLayer->size();
86 mAngle = mMarkerSymbolLayer->angle();
87 mMarkerOffset = mMarkerSymbolLayer->offset();
91 mWidth = mLineSymbolLayer->width();
92 mLineOffset = mLineSymbolLayer->offset();
96void DataDefinedRestorer::restore()
101 ( mSize != mMarkerSymbolLayer->size() || mMarkerOffset != mMarkerSymbolLayer->offset() ) )
102 mMarker->setDataDefinedSize( mDDSize );
104 mAngle != mMarkerSymbolLayer->angle() )
105 mMarker->setDataDefinedAngle( mDDAngle );
110 ( mWidth != mLineSymbolLayer->width() || mLineOffset != mLineSymbolLayer->offset() ) )
111 mLine->setDataDefinedWidth( mDDWidth );
118class SymbolLayerItem :
public QStandardItem
122 : mVectorLayer( vectorLayer )
125 setLayer( layer, symbolType );
129 : mVectorLayer( vectorLayer )
140 mSymbolType = symbolType;
154 if ( !mSize.isValid() )
157 mSize = QSize( size, size );
170 if (
auto *lParent = parent() )
171 static_cast<SymbolLayerItem *
>( lParent )->updatePreview();
174 int type()
const override {
return SYMBOL_LAYER_ITEM_TYPE; }
175 bool isLayer() {
return mIsLayer; }
188 QVariant data(
int role )
const override
190 if ( role == Qt::DisplayRole || role == Qt::EditRole )
202 switch ( mSymbol->type() )
205 return QCoreApplication::translate(
"SymbolLayerItem",
"Marker" );
207 return QCoreApplication::translate(
"SymbolLayerItem",
"Fill" );
209 return QCoreApplication::translate(
"SymbolLayerItem",
"Line" );
215 else if ( role == Qt::ForegroundRole && mIsLayer )
217 if ( !mLayer->enabled() )
219 QPalette
pal = qApp->palette();
220 QBrush brush = QStandardItem::data( role ).value< QBrush >();
221 brush.setColor(
pal.color( QPalette::Disabled, QPalette::WindowText ) );
232 if ( role == Qt::CheckStateRole )
234 return QStandardItem::data( role );
240 QPointer< QgsVectorLayer > mVectorLayer;
241 bool mIsLayer =
false;
244 QPointer< QScreen > mScreen;
258 setWindowModality( Qt::WindowModal );
262 this->layout()->setContentsMargins( 0, 0, 0, 0 );
264 layersTree->setMaximumHeight(
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().height() * 7 ) );
265 layersTree->setMinimumHeight( layersTree->maximumHeight() );
266 lblPreview->setMaximumWidth( layersTree->maximumHeight() );
274 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
275 iconLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"unlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
278 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
279 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
280 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
281 iconColorLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconColorUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
283 mLockColorAction =
new QAction( tr(
"Lock Color" ),
this );
284 mLockColorAction->setToolTip( tr(
"Avoid changing the color of the layer when the symbol color is changed" ) );
285 mLockColorAction->setCheckable(
true );
286 mLockColorAction->setIcon( iconColorLock );
288 QIcon iconSelectLock;
289 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Normal, QIcon::On );
290 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectLocked.svg" ) ), QSize(), QIcon::Active, QIcon::On );
291 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Normal, QIcon::Off );
292 iconSelectLock.addFile(
QgsApplication::iconPath( QStringLiteral(
"mIconSelectUnlocked.svg" ) ), QSize(), QIcon::Active, QIcon::Off );
294 mLockSelectionColorAction =
new QAction( tr(
"Lock Color When Selected" ),
this );
295 mLockSelectionColorAction->setToolTip( tr(
"Avoid changing the color of the layer when a feature is selected" ) );
296 mLockSelectionColorAction->setCheckable(
true );
297 mLockSelectionColorAction->setIcon( iconSelectLock );
299 QMenu *lockMenu =
new QMenu(
this );
300 lockMenu->addAction( mLockColorAction );
301 lockMenu->addAction( mLockSelectionColorAction );
302 btnLock->setMenu( lockMenu );
303 btnLock->setPopupMode( QToolButton::InstantPopup );
309 mSymbolLayersModel =
new QStandardItemModel( layersTree );
311 layersTree->setModel( mSymbolLayersModel );
312 layersTree->setHeaderHidden(
true );
324 mPreviewExpressionContext.
setFeature( mPreviewFeature );
332 QItemSelectionModel *selModel = layersTree->selectionModel();
335 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
343 connect( mLockSelectionColorAction, &QAction::toggled,
this, [ = ](
bool checked )
349 Qgis::SymbolLayerUserFlags flags = layer->
userFlags();
352 updateLockButtonIcon();
358 updateLockButtonIcon();
363 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
364 layersTree->setCurrentIndex( newIndex );
391 if ( !mAdvancedMenu )
393 mAdvancedMenu =
new QMenu(
this );
397 return mAdvancedMenu;
406 mPreviewExpressionContext = *lExpressionContext;
410 mPreviewExpressionContext.
setFeature( mPreviewFeature );
413 QWidget *widget = stackedWidget->currentWidget();
415 layerProp->setContext(
context );
417 listWidget->setContext(
context );
436 mSymbolLayersModel->clear();
437 parent =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() );
440 SymbolLayerItem *symbolItem =
new SymbolLayerItem(
symbol, mVectorLayer, screen() );
441 QFont boldFont = symbolItem->font();
442 boldFont.setBold(
true );
443 symbolItem->setFont( boldFont );
444 parent->appendRow( symbolItem );
447 for (
int i = count - 1; i >= 0; i-- )
450 layerItem->setEditable(
false );
451 symbolItem->appendRow( layerItem );
456 layersTree->setExpanded( layerItem->index(),
true );
458 layersTree->setExpanded( symbolItem->index(),
true );
460 if ( mSymbol ==
symbol && !layersTree->currentIndex().isValid() )
463 layersTree->setCurrentIndex( symbolItem->index() );
467void QgsSymbolSelectorWidget::reloadSymbol()
469 mSymbolLayersModel->clear();
470 loadSymbol( mSymbol,
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->invisibleRootItem() ) );
473void QgsSymbolSelectorWidget::updateUi()
475 const QModelIndex currentIdx = layersTree->currentIndex();
476 if ( !currentIdx.isValid() )
479 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( currentIdx ) );
480 if ( !item->isLayer() )
482 btnUp->setEnabled(
false );
483 btnDown->setEnabled(
false );
484 btnRemoveLayer->setEnabled(
false );
485 btnLock->setEnabled(
false );
486 btnDuplicate->setEnabled(
false );
490 const int rowCount = item->parent()->rowCount();
491 const int currentRow = item->row();
493 btnUp->setEnabled( currentRow > 0 );
494 btnDown->setEnabled( currentRow < rowCount - 1 );
495 btnRemoveLayer->setEnabled( rowCount > 1 );
496 btnLock->setEnabled(
true );
497 btnDuplicate->setEnabled(
true );
505 std::unique_ptr< QgsSymbol > symbolClone( mSymbol->
clone() );
507 lblPreview->setPixmap( QPixmap::fromImage( preview ) );
509 if ( !mBlockModified )
516 SymbolLayerItem *item = currentLayerItem();
518 item->updatePreview();
523SymbolLayerItem *QgsSymbolSelectorWidget::currentLayerItem()
525 const QModelIndex idx = layersTree->currentIndex();
526 if ( !idx.isValid() )
529 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
530 if ( !item->isLayer() )
538 const QModelIndex idx = layersTree->currentIndex();
539 if ( !idx.isValid() )
542 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
543 if ( item->isLayer() )
544 return item->layer();
553 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
557 if ( currentItem->isLayer() )
559 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
560 mDataDefineRestorer.reset(
new DataDefinedRestorer( parent->symbol(), currentItem->layer() ) );
564 setWidget( layerProp );
575 mDataDefineRestorer.reset();
577 currentItem->symbol()->setLayer( mVectorLayer );
581 symbolsList->setContext( mContext );
583 setWidget( symbolsList );
591 SymbolLayerItem *currentItem =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( layersTree->currentIndex() ) );
592 if ( !currentItem || currentItem->isLayer() )
596 if ( currentItem->parent() )
600 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( currentItem->parent() );
601 parent->removeRow( 0 );
603 layersTree->setCurrentIndex( parent->child( 0 )->index() );
604 parent->updatePreview();
610 const QModelIndex newIndex = layersTree->model()->index( 0, 0 );
611 layersTree->setCurrentIndex( newIndex );
618void QgsSymbolSelectorWidget::setWidget( QWidget *widget )
620 const int index = stackedWidget->addWidget( widget );
621 stackedWidget->setCurrentIndex( index );
622 if ( mPresentWidget )
623 mPresentWidget->deleteLater();
624 mPresentWidget = widget;
627void QgsSymbolSelectorWidget::updateLockButton()
632 mLockColorAction->setChecked( layer->
isLocked() );
635 updateLockButtonIcon();
638void QgsSymbolSelectorWidget::updateLockButtonIcon()
640 if ( mLockColorAction->isChecked() && mLockSelectionColorAction->isChecked() )
642 else if ( mLockColorAction->isChecked() )
644 else if ( mLockSelectionColorAction->isChecked() )
652 const QModelIndex idx = layersTree->currentIndex();
653 if ( !idx.isValid() )
657 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
658 if ( item->isLayer() )
660 insertIdx = item->row();
661 item =
static_cast<SymbolLayerItem *
>( item->parent() );
664 QgsSymbol *parentSymbol = item->symbol();
678 if ( insertIdx == -1 )
685 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedSize( ddSize );
687 static_cast<QgsMarkerSymbol *
>( parentSymbol )->setDataDefinedAngle( ddAngle );
689 static_cast<QgsLineSymbol *
>( parentSymbol )->setDataDefinedWidth( ddWidth );
691 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
692 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
693 item->updatePreview();
695 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
702 SymbolLayerItem *item = currentLayerItem();
703 const int row = item->row();
704 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
706 const int layerIdx = parent->rowCount() - row - 1;
707 QgsSymbol *parentSymbol = parent->symbol();
710 parent->removeRow( row );
711 parent->updatePreview();
713 const QModelIndex newIdx = parent->child( 0 )->index();
714 layersTree->setCurrentIndex( newIdx );
724 moveLayerByOffset( + 1 );
729 moveLayerByOffset( -1 );
732void QgsSymbolSelectorWidget::moveLayerByOffset(
int offset )
734 SymbolLayerItem *item = currentLayerItem();
737 const int row = item->row();
739 SymbolLayerItem *parent =
static_cast<SymbolLayerItem *
>( item->parent() );
740 QgsSymbol *parentSymbol = parent->symbol();
742 const int layerIdx = parent->rowCount() - row - 1;
747 QList<QStandardItem *> rowItems = parent->takeRow( row );
748 parent->insertRows( row + offset, rowItems );
749 parent->updatePreview();
751 const QModelIndex newIdx = rowItems[ 0 ]->index();
752 layersTree->setCurrentIndex( newIdx );
763 layer->
setLocked( mLockColorAction->isChecked() );
764 updateLockButtonIcon();
770 const QModelIndex idx = layersTree->currentIndex();
771 if ( !idx.isValid() )
774 SymbolLayerItem *item =
static_cast<SymbolLayerItem *
>( mSymbolLayersModel->itemFromIndex( idx ) );
775 if ( !item->isLayer() )
780 const int insertIdx = item->row();
781 item =
static_cast<SymbolLayerItem *
>( item->parent() );
783 QgsSymbol *parentSymbol = item->symbol();
787 if ( insertIdx == -1 )
792 SymbolLayerItem *newLayerItem =
new SymbolLayerItem( newLayer, parentSymbol->
type(), mVectorLayer, screen() );
793 item->insertRow( insertIdx == -1 ? 0 : insertIdx, newLayerItem );
797 layersTree->setExpanded( newLayerItem->index(),
true );
799 item->updatePreview();
801 layersTree->setCurrentIndex( mSymbolLayersModel->indexFromItem( newLayerItem ) );
808 SymbolLayerItem *item = currentLayerItem();
813 item->removeRow( 0 );
823 layersTree->setExpanded( item->index(),
true );
827 const int layerIdx = item->parent()->rowCount() - item->row() - 1;
830 item->updatePreview();
839 setLayout(
new QVBoxLayout() );
842 mButtonBox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
844 connect( mButtonBox, &QDialogButtonBox::accepted,
this, &QDialog::accept );
845 connect( mButtonBox, &QDialogButtonBox::rejected,
this, &QDialog::reject );
846 connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsSymbolSelectorDialog::showHelp );
848 layout()->addWidget( mSelectorWidget );
849 layout()->addWidget( mButtonBox );
853 mSelectorWidget->setMinimumSize( 460, 560 );
854 setObjectName( QStringLiteral(
"SymbolSelectorDialog" ) );
861 layout()->setContentsMargins( 0, 0, 0, 0 );
865 setWindowTitle( tr(
"Symbol Selector" ) );
887 return mSelectorWidget->
symbol();
893 if ( !isWindow() && e->key() == Qt::Key_Escape )
899 QDialog::keyPressEvent( e );
903void QgsSymbolSelectorDialog::reloadSymbol()
905 mSelectorWidget->reloadSymbol();
913void QgsSymbolSelectorDialog::updateUi()
915 mSelectorWidget->updateUi();
918void QgsSymbolSelectorDialog::updateLockButton()
920 mSelectorWidget->updateLockButton();
923SymbolLayerItem *QgsSymbolSelectorDialog::currentLayerItem()
925 return mSelectorWidget->currentLayerItem();
930 return mSelectorWidget->currentLayer();
933void QgsSymbolSelectorDialog::moveLayerByOffset(
int offset )
935 mSelectorWidget->moveLayerByOffset( offset );
938void QgsSymbolSelectorDialog::setWidget( QWidget *widget )
940 mSelectorWidget->setWidget( widget );
1003void QgsSymbolSelectorDialog::showHelp()
1008void QgsSymbolSelectorWidget::projectDataChanged()
1010 mBlockModified =
true;
1013 mBlockModified =
false;
1016void QgsSymbolSelectorWidget::layersAboutToBeRemoved(
const QList<QgsMapLayer *> &layers )
1018 if ( mVectorLayer && layers.contains( mVectorLayer ) )
@ 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.
SymbolType
Attribute editing capabilities which may be supported by vector data providers.
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)
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.
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