18#include "moc_qgssymbollayerwidget.cpp"
49#include <QAbstractButton>
50#include <QButtonGroup>
51#include <QColorDialog>
56#include <QStandardItemModel>
57#include <QSvgRenderer>
61#include <QInputDialog>
63#include <QRegularExpression>
69 return *lExpressionContext;
80 expContext << symbolScope;
102 QStringList highlights;
108 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" ) << QStringLiteral(
"symbol_frame" );
111 if ( expContext.
hasVariable( QStringLiteral(
"zoom_level" ) ) )
113 highlights << QStringLiteral(
"zoom_level" );
115 if ( expContext.
hasVariable( QStringLiteral(
"vector_tile_zoom" ) ) )
117 highlights << QStringLiteral(
"vector_tile_zoom" );
128 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
131 unitWidget->setMapCanvas( mContext.
mapCanvas() );
149void QgsSymbolLayerWidget::createAuxiliaryField()
170 if ( dlg.exec() == QDialog::Accepted )
171 def = dlg.propertyDefinition();
181 property.setActive(
true );
203 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
204 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
208 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
210 connect( mCheckAlignDash, &QCheckBox::toggled,
this, [=] {
211 mCheckDashCorners->setEnabled( mCheckAlignDash->isChecked() );
212 if ( !mCheckAlignDash->isChecked() )
213 mCheckDashCorners->setChecked(
false );
221 connect( mCheckDashCorners, &QCheckBox::toggled,
this, [=] {
236 btnChangeColor->setAllowOpacity(
true );
237 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
238 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
240 mColorDDBtn->registerLinkedWidget( btnChangeColor );
245 connect( mRingFilterComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=](
int ) {
253 spinOffset->setClearValue( 0.0 );
254 spinPatternOffset->setClearValue( 0.0 );
256 mTrimStartDistanceSpin->setClearValue( 0.0 );
257 mTrimDistanceEndSpin->setClearValue( 0.0 );
263 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
265 connect( spinWidth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
267 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
268 connect( spinOffset,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
269 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
270 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
271 connect( spinPatternOffset,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::patternOffsetChanged );
273 connect( mTrimStartDistanceSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=](
double value ) {
288 connect( mTrimDistanceEndSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=](
double value ) {
312void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
314 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1; i >= 0; --i )
316 mAssistantPreviewSymbol->deleteSymbolLayer( i );
318 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
321 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
327 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
334 mPenWidthUnitWidget->blockSignals(
true );
337 mPenWidthUnitWidget->blockSignals(
false );
338 mOffsetUnitWidget->blockSignals(
true );
341 mOffsetUnitWidget->blockSignals(
false );
342 mDashPatternUnitWidget->blockSignals(
true );
345 mDashPatternUnitWidget->blockSignals(
false );
355 spinWidth->blockSignals(
true );
357 spinWidth->blockSignals(
false );
358 btnChangeColor->blockSignals(
true );
360 btnChangeColor->blockSignals(
false );
361 spinOffset->blockSignals(
true );
363 spinOffset->blockSignals(
false );
364 cboPenStyle->blockSignals(
true );
365 cboJoinStyle->blockSignals(
true );
366 cboCapStyle->blockSignals(
true );
370 cboPenStyle->blockSignals(
false );
371 cboJoinStyle->blockSignals(
false );
372 cboCapStyle->blockSignals(
false );
379 mChangePatternButton->setEnabled( useCustomDashPattern );
380 label_3->setEnabled( !useCustomDashPattern );
381 cboPenStyle->setEnabled( !useCustomDashPattern );
382 mCustomCheckBox->blockSignals(
true );
383 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
384 mCustomCheckBox->blockSignals(
false );
387 const QSize size = mChangePatternButton->minimumSizeHint();
389 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
393 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
414 updateAssistantSymbol();
431 mDrawInsideCheckBox->hide();
432 mRingFilterComboBox->hide();
442void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
449void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
455void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
464void QgsSimpleLineSymbolLayerWidget::offsetChanged()
471void QgsSimpleLineSymbolLayerWidget::patternOffsetChanged()
478void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
480 const bool checked = ( state == Qt::Checked );
481 mChangePatternButton->setEnabled( checked );
482 label_3->setEnabled( !checked );
483 cboPenStyle->setEnabled( !checked );
489void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
496 widget->
setUnit( mDashPatternUnitWidget->unit() );
507 d.setUnit( mDashPatternUnitWidget->unit() );
508 if ( d.exec() == QDialog::Accepted )
516void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
527void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
537void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
548void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
550 const bool checked = ( state == Qt::Checked );
555void QgsSimpleLineSymbolLayerWidget::patternOffsetUnitChanged()
572 std::unique_ptr<QgsSimpleLineSymbolLayer> layerCopy(
mLayer->
clone() );
577 const QColor color = qApp->palette().color( QPalette::WindowText );
578 layerCopy->setColor( color );
580 layerCopy->setOffset( 0 );
581 layerCopy->setUseCustomDashPattern(
true );
583 QSize currentIconSize;
586 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
588 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
591 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
597 const std::unique_ptr<QgsLineSymbol> previewSymbol = std::make_unique<QgsLineSymbol>(
QgsSymbolLayerList() << layerCopy.release() );
599 mChangePatternButton->setIconSize( currentIconSize );
600 mChangePatternButton->setIcon( icon );
604 const int width =
static_cast<int>(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
605 const int height =
static_cast<int>( width / 1.61803398875 );
609 QBuffer buffer( &data );
610 pm.save( &buffer,
"PNG", 100 );
611 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3' width=\"%4\">" ).arg( QString( data.toBase64() ) ).arg( width ) );
616 QgsSymbolLayerWidget::resizeEvent( event );
634 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
635 connect( mStrokeWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
636 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
637 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
642 btnChangeColorFill->setAllowOpacity(
true );
643 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
644 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
645 btnChangeColorFill->setShowNoColor(
true );
646 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
647 btnChangeColorStroke->setAllowOpacity(
true );
648 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
649 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
650 btnChangeColorStroke->setShowNoColor(
true );
651 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
653 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
654 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
656 spinOffsetX->setClearValue( 0.0 );
657 spinOffsetY->setClearValue( 0.0 );
658 spinAngle->setClearValue( 0.0 );
664 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
666 int size = lstNames->iconSize().width();
668 size = std::max( 30,
static_cast<int>( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
670 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
671 lstNames->setIconSize( QSize( size, size ) );
673 const double markerSize = size * 0.8;
679 lyr->
setColor( QColor( 200, 200, 200 ) );
682 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
683 item->setData( Qt::UserRole,
static_cast<int>( shape ) );
688 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
690 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
693 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
694 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged );
695 connect( spinSize,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
696 connect( spinAngle,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
697 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
698 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
706 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
714 for (
int i = 0; i < lstNames->count(); ++i )
716 if (
static_cast<Qgis::MarkerShape>( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
718 lstNames->setCurrentRow( i );
722 btnChangeColorStroke->blockSignals(
true );
724 btnChangeColorStroke->blockSignals(
false );
725 btnChangeColorFill->blockSignals(
true );
728 btnChangeColorFill->blockSignals(
false );
729 spinSize->blockSignals(
true );
731 spinSize->blockSignals(
false );
732 spinAngle->blockSignals(
true );
734 spinAngle->blockSignals(
false );
735 mStrokeStyleComboBox->blockSignals(
true );
737 mStrokeStyleComboBox->blockSignals(
false );
738 mStrokeWidthSpinBox->blockSignals(
true );
740 mStrokeWidthSpinBox->blockSignals(
false );
741 cboJoinStyle->blockSignals(
true );
743 cboJoinStyle->blockSignals(
false );
744 cboCapStyle->blockSignals(
true );
746 cboCapStyle->blockSignals(
false );
749 spinOffsetX->blockSignals(
true );
751 spinOffsetX->blockSignals(
false );
752 spinOffsetY->blockSignals(
true );
754 spinOffsetY->blockSignals(
false );
756 mSizeUnitWidget->blockSignals(
true );
759 mSizeUnitWidget->blockSignals(
false );
760 mOffsetUnitWidget->blockSignals(
true );
763 mOffsetUnitWidget->blockSignals(
false );
764 mStrokeWidthUnitWidget->blockSignals(
true );
767 mStrokeWidthUnitWidget->blockSignals(
false );
770 mHorizontalAnchorComboBox->blockSignals(
true );
771 mVerticalAnchorComboBox->blockSignals(
true );
774 mHorizontalAnchorComboBox->blockSignals(
false );
775 mVerticalAnchorComboBox->blockSignals(
false );
790 updateAssistantSymbol();
798void QgsSimpleMarkerSymbolLayerWidget::setShape()
817void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
823void QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged()
829void QgsSimpleMarkerSymbolLayerWidget::setSize()
835void QgsSimpleMarkerSymbolLayerWidget::setAngle()
841void QgsSimpleMarkerSymbolLayerWidget::setOffset()
843 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
847void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
858void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
867void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
877void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
887void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
897void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
906void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
915void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
917 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1; i >= 0; --i )
919 mAssistantPreviewSymbol->deleteSymbolLayer( i );
921 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
924 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
941 btnChangeColor->setAllowOpacity(
true );
942 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
943 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
944 btnChangeColor->setShowNoColor(
true );
945 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
946 btnChangeStrokeColor->setAllowOpacity(
true );
947 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
948 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
949 btnChangeStrokeColor->setShowNoColor(
true );
950 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
952 spinOffsetX->setClearValue( 0.0 );
953 spinOffsetY->setClearValue( 0.0 );
956 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
958 connect( spinStrokeWidth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
959 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
960 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
961 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
962 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
964 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
965 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
970 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
977 btnChangeColor->blockSignals(
true );
979 btnChangeColor->blockSignals(
false );
980 cboFillStyle->blockSignals(
true );
982 cboFillStyle->blockSignals(
false );
983 btnChangeStrokeColor->blockSignals(
true );
985 btnChangeStrokeColor->blockSignals(
false );
986 cboStrokeStyle->blockSignals(
true );
988 cboStrokeStyle->blockSignals(
false );
989 spinStrokeWidth->blockSignals(
true );
991 spinStrokeWidth->blockSignals(
false );
992 cboJoinStyle->blockSignals(
true );
994 cboJoinStyle->blockSignals(
false );
995 spinOffsetX->blockSignals(
true );
997 spinOffsetX->blockSignals(
false );
998 spinOffsetY->blockSignals(
true );
1000 spinOffsetY->blockSignals(
false );
1002 mStrokeWidthUnitWidget->blockSignals(
true );
1005 mStrokeWidthUnitWidget->blockSignals(
false );
1006 mOffsetUnitWidget->blockSignals(
true );
1009 mOffsetUnitWidget->blockSignals(
false );
1037void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
1043void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
1049void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
1056void QgsSimpleFillSymbolLayerWidget::offsetChanged()
1058 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1062void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
1072void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1092 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1093 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1097 spinOffsetX->setClearValue( 0.0 );
1098 spinOffsetY->setClearValue( 0.0 );
1099 spinAngle->setClearValue( 0.0 );
1105 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
1107 int size = lstNames->iconSize().width();
1108 size = std::max( 30,
static_cast<int>( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
1109 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
1110 lstNames->setIconSize( QSize( size, size ) );
1112 const double markerSize = size * 0.8;
1118 lyr->
setColor( QColor( 200, 200, 200 ) );
1121 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1122 item->setData( Qt::UserRole,
static_cast<int>( shape ) );
1127 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1129 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1130 connect( spinSize,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1131 connect( spinAngle,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1132 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1133 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1141 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1149 for (
int i = 0; i < lstNames->count(); ++i )
1151 if (
static_cast<Qgis::MarkerShape>( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1153 lstNames->setCurrentRow( i );
1162 mSizeUnitWidget->blockSignals(
true );
1165 mSizeUnitWidget->blockSignals(
false );
1166 mOffsetUnitWidget->blockSignals(
true );
1169 mOffsetUnitWidget->blockSignals(
false );
1182 updateAssistantSymbol();
1190void QgsFilledMarkerSymbolLayerWidget::setShape()
1196void QgsFilledMarkerSymbolLayerWidget::setSize()
1202void QgsFilledMarkerSymbolLayerWidget::setAngle()
1208void QgsFilledMarkerSymbolLayerWidget::setOffset()
1210 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1214void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1224void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1234void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1243void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1252void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1254 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1; i >= 0; --i )
1256 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1258 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1261 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1274 connect( mSpinAngle,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1277 btnColorRamp->setShowGradientOnly(
true );
1279 btnChangeColor->setAllowOpacity(
true );
1280 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1281 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1282 btnChangeColor->setShowNoColor(
true );
1283 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1284 btnChangeColor2->setAllowOpacity(
true );
1285 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1286 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1287 btnChangeColor2->setShowNoColor(
true );
1288 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1290 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1291 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1293 spinOffsetX->setClearValue( 0.0 );
1294 spinOffsetY->setClearValue( 0.0 );
1295 mSpinAngle->setClearValue( 0.0 );
1303 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1304 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1305 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1306 connect( spinRefPoint1X,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1307 connect( spinRefPoint1Y,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1308 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1309 connect( spinRefPoint2X,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1310 connect( spinRefPoint2Y,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1311 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1316 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1323 btnChangeColor->blockSignals(
true );
1325 btnChangeColor->blockSignals(
false );
1326 btnChangeColor2->blockSignals(
true );
1328 btnChangeColor2->blockSignals(
false );
1332 radioTwoColor->setChecked(
true );
1333 btnColorRamp->setEnabled(
false );
1337 radioColorRamp->setChecked(
true );
1338 btnChangeColor->setEnabled(
false );
1339 btnChangeColor2->setEnabled(
false );
1345 btnColorRamp->blockSignals(
true );
1347 btnColorRamp->blockSignals(
false );
1350 cboGradientType->blockSignals(
true );
1354 cboGradientType->setCurrentIndex( 0 );
1357 cboGradientType->setCurrentIndex( 1 );
1360 cboGradientType->setCurrentIndex( 2 );
1363 cboGradientType->blockSignals(
false );
1365 cboCoordinateMode->blockSignals(
true );
1369 cboCoordinateMode->setCurrentIndex( 1 );
1370 checkRefPoint1Centroid->setEnabled(
false );
1371 checkRefPoint2Centroid->setEnabled(
false );
1375 cboCoordinateMode->setCurrentIndex( 0 );
1378 cboCoordinateMode->blockSignals(
false );
1380 cboGradientSpread->blockSignals(
true );
1384 cboGradientSpread->setCurrentIndex( 0 );
1387 cboGradientSpread->setCurrentIndex( 1 );
1390 cboGradientSpread->setCurrentIndex( 2 );
1393 cboGradientSpread->blockSignals(
false );
1395 spinRefPoint1X->blockSignals(
true );
1397 spinRefPoint1X->blockSignals(
false );
1398 spinRefPoint1Y->blockSignals(
true );
1400 spinRefPoint1Y->blockSignals(
false );
1401 checkRefPoint1Centroid->blockSignals(
true );
1405 spinRefPoint1X->setEnabled(
false );
1406 spinRefPoint1Y->setEnabled(
false );
1408 checkRefPoint1Centroid->blockSignals(
false );
1409 spinRefPoint2X->blockSignals(
true );
1411 spinRefPoint2X->blockSignals(
false );
1412 spinRefPoint2Y->blockSignals(
true );
1414 spinRefPoint2Y->blockSignals(
false );
1415 checkRefPoint2Centroid->blockSignals(
true );
1419 spinRefPoint2X->setEnabled(
false );
1420 spinRefPoint2Y->setEnabled(
false );
1422 checkRefPoint2Centroid->blockSignals(
false );
1424 spinOffsetX->blockSignals(
true );
1426 spinOffsetX->blockSignals(
false );
1427 spinOffsetY->blockSignals(
true );
1429 spinOffsetY->blockSignals(
false );
1430 mSpinAngle->blockSignals(
true );
1432 mSpinAngle->blockSignals(
false );
1434 mOffsetUnitWidget->blockSignals(
true );
1437 mOffsetUnitWidget->blockSignals(
false );
1471void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1473 if ( radioTwoColor->isChecked() )
1486 if ( btnColorRamp->isNull() )
1500 spinRefPoint1X->setValue( 0.5 );
1501 spinRefPoint1Y->setValue( 0 );
1502 spinRefPoint2X->setValue( 0.5 );
1503 spinRefPoint2Y->setValue( 1 );
1508 spinRefPoint1X->setValue( 0 );
1509 spinRefPoint1Y->setValue( 0 );
1510 spinRefPoint2X->setValue( 1 );
1511 spinRefPoint2Y->setValue( 1 );
1515 spinRefPoint1X->setValue( 0.5 );
1516 spinRefPoint1Y->setValue( 0.5 );
1517 spinRefPoint2X->setValue( 1 );
1518 spinRefPoint2Y->setValue( 1 );
1532 checkRefPoint1Centroid->setEnabled(
true );
1533 checkRefPoint2Centroid->setEnabled(
true );
1539 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1540 checkRefPoint1Centroid->setEnabled(
false );
1541 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1542 checkRefPoint2Centroid->setEnabled(
false );
1567void QgsGradientFillSymbolLayerWidget::offsetChanged()
1569 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1573void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1582void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1588void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1606 connect( mSpinBlurRadius, qOverload<int>( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1607 connect( mSpinMaxDistance, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1609 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1611 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1615 QButtonGroup *group1 =
new QButtonGroup(
this );
1616 group1->addButton( radioColorRamp );
1617 group1->addButton( radioTwoColor );
1618 QButtonGroup *group2 =
new QButtonGroup(
this );
1619 group2->addButton( mRadioUseMaxDistance );
1620 group2->addButton( mRadioUseWholeShape );
1621 btnChangeColor->setAllowOpacity(
true );
1622 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1623 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1624 btnChangeColor->setShowNoColor(
true );
1625 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1626 btnChangeColor2->setAllowOpacity(
true );
1627 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1628 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1629 btnChangeColor2->setShowNoColor(
true );
1630 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1632 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1633 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1635 spinOffsetX->setClearValue( 0.0 );
1636 spinOffsetY->setClearValue( 0.0 );
1637 mSpinMaxDistance->setClearValue( 5.0 );
1639 btnColorRamp->setShowGradientOnly(
true );
1645 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1646 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1647 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1649 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1650 connect( mSpinBlurRadius,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1655 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1662 btnChangeColor->blockSignals(
true );
1664 btnChangeColor->blockSignals(
false );
1665 btnChangeColor2->blockSignals(
true );
1667 btnChangeColor2->blockSignals(
false );
1671 radioTwoColor->setChecked(
true );
1672 btnColorRamp->setEnabled(
false );
1676 radioColorRamp->setChecked(
true );
1677 btnChangeColor->setEnabled(
false );
1678 btnChangeColor2->setEnabled(
false );
1681 mSpinBlurRadius->blockSignals(
true );
1682 mBlurSlider->blockSignals(
true );
1685 mSpinBlurRadius->blockSignals(
false );
1686 mBlurSlider->blockSignals(
false );
1688 mSpinMaxDistance->blockSignals(
true );
1690 mSpinMaxDistance->blockSignals(
false );
1692 mRadioUseWholeShape->blockSignals(
true );
1693 mRadioUseMaxDistance->blockSignals(
true );
1696 mRadioUseWholeShape->setChecked(
true );
1697 mSpinMaxDistance->setEnabled(
false );
1698 mDistanceUnitWidget->setEnabled(
false );
1702 mRadioUseMaxDistance->setChecked(
true );
1703 mSpinMaxDistance->setEnabled(
true );
1704 mDistanceUnitWidget->setEnabled(
true );
1706 mRadioUseWholeShape->blockSignals(
false );
1707 mRadioUseMaxDistance->blockSignals(
false );
1709 mDistanceUnitWidget->blockSignals(
true );
1712 mDistanceUnitWidget->blockSignals(
false );
1714 mIgnoreRingsCheckBox->blockSignals(
true );
1715 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1716 mIgnoreRingsCheckBox->blockSignals(
false );
1721 btnColorRamp->blockSignals(
true );
1723 btnColorRamp->blockSignals(
false );
1726 spinOffsetX->blockSignals(
true );
1728 spinOffsetX->blockSignals(
false );
1729 spinOffsetY->blockSignals(
true );
1731 spinOffsetY->blockSignals(
false );
1732 mOffsetUnitWidget->blockSignals(
true );
1735 mOffsetUnitWidget->blockSignals(
false );
1769void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1776 if ( radioTwoColor->isChecked() )
1787void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1796void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1805void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1815void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1820 mDistanceUnitWidget->setEnabled( !value );
1825void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1835void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1839 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1844void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1855void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1857 const bool checked = ( state == Qt::Checked );
1882 connect( mRingFilterComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=](
int ) {
1890 spinOffset->setClearValue( 0.0 );
1891 mSpinOffsetAlongLine->setClearValue( 0.0 );
1892 mSpinAverageAngleLength->setClearValue( 4.0 );
1896 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1897 connect( spinOffset,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1898 connect( mSpinAverageAngleLength,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1899 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1900 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1901 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1902 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1903 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1904 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1905 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1906 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [=] {
1917 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1924 spinInterval->blockSignals(
true );
1926 spinInterval->blockSignals(
false );
1927 mSpinOffsetAlongLine->blockSignals(
true );
1929 mSpinOffsetAlongLine->blockSignals(
false );
1930 chkRotateMarker->blockSignals(
true );
1932 chkRotateMarker->blockSignals(
false );
1933 spinOffset->blockSignals(
true );
1935 spinOffset->blockSignals(
false );
1947 mIntervalUnitWidget->blockSignals(
true );
1950 mIntervalUnitWidget->blockSignals(
false );
1951 mOffsetUnitWidget->blockSignals(
true );
1954 mOffsetUnitWidget->blockSignals(
false );
1955 mOffsetAlongLineUnitWidget->blockSignals(
true );
1958 mOffsetAlongLineUnitWidget->blockSignals(
false );
1989 mRingFilterComboBox->hide();
1990 mRingsLabel->hide();
2011void QgsMarkerLineSymbolLayerWidget::setRotate()
2013 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2014 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2020void QgsMarkerLineSymbolLayerWidget::setOffset()
2026void QgsMarkerLineSymbolLayerWidget::setPlacement()
2028 const bool interval = mCheckInterval->isChecked();
2029 spinInterval->setEnabled( interval );
2030 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2031 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2032 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2033 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2034 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2037 if ( mCheckInterval->isChecked() )
2039 if ( mCheckVertex->isChecked() )
2041 if ( mCheckVertexLast->isChecked() )
2043 if ( mCheckVertexFirst->isChecked() )
2045 if ( mCheckCurvePoint->isChecked() )
2047 if ( mCheckSegmentCentralPoint->isChecked() )
2049 if ( mCheckCentralPoint->isChecked() )
2056void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2066void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2076void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2086void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
2096void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2128 connect( mRingFilterComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=](
int ) {
2136 spinOffset->setClearValue( 0.0 );
2137 mSpinOffsetAlongLine->setClearValue( 0.0 );
2138 mHashRotationSpinBox->setClearValue( 0 );
2139 mSpinAverageAngleLength->setClearValue( 4.0 );
2141 connect( spinInterval,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2142 connect( mSpinOffsetAlongLine,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2143 connect( mSpinHashLength,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2144 connect( mHashRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2145 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2146 connect( spinOffset,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2147 connect( mSpinAverageAngleLength,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2149 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2150 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2151 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2152 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2153 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2154 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2155 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2157 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [=] {
2168 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2175 spinInterval->blockSignals(
true );
2176 spinInterval->setValue( mLayer->
interval() );
2177 spinInterval->blockSignals(
false );
2178 mSpinOffsetAlongLine->blockSignals(
true );
2180 mSpinOffsetAlongLine->blockSignals(
false );
2183 chkRotateMarker->blockSignals(
true );
2185 chkRotateMarker->blockSignals(
false );
2186 spinOffset->blockSignals(
true );
2187 spinOffset->setValue( mLayer->
offset() );
2188 spinOffset->blockSignals(
false );
2200 mIntervalUnitWidget->blockSignals(
true );
2201 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2203 mIntervalUnitWidget->blockSignals(
false );
2204 mOffsetUnitWidget->blockSignals(
true );
2205 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2207 mOffsetUnitWidget->blockSignals(
false );
2208 mOffsetAlongLineUnitWidget->blockSignals(
true );
2211 mOffsetAlongLineUnitWidget->blockSignals(
false );
2218 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2245 mRingFilterComboBox->hide();
2246 mRingsLabel->hide();
2255void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2261void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2267void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2273void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2279void QgsHashedLineSymbolLayerWidget::setRotate()
2281 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2282 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2288void QgsHashedLineSymbolLayerWidget::setOffset()
2290 mLayer->
setOffset( spinOffset->value() );
2294void QgsHashedLineSymbolLayerWidget::setPlacement()
2296 const bool interval = mCheckInterval->isChecked();
2297 spinInterval->setEnabled( interval );
2298 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2299 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2300 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2301 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2302 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2305 if ( mCheckInterval->isChecked() )
2307 if ( mCheckVertex->isChecked() )
2309 if ( mCheckVertexLast->isChecked() )
2311 if ( mCheckVertexFirst->isChecked() )
2313 if ( mCheckCurvePoint->isChecked() )
2315 if ( mCheckSegmentCentralPoint->isChecked() )
2317 if ( mCheckCentralPoint->isChecked() )
2324void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2334void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2344void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2354void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2364void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2374void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2393 mSvgSelectorWidget->setAllowParameters(
true );
2394 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2395 mSvgSelectorWidget->sourceLineEdit()->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2396 mSvgSelectorWidget->initParametersModel(
this, vl );
2400 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2401 connect( mStrokeWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2405 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2406 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2410 mChangeColorButton->setAllowOpacity(
true );
2411 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2412 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2413 mChangeStrokeColorButton->setAllowOpacity(
true );
2414 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2415 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2417 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2418 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2420 spinOffsetX->setClearValue( 0.0 );
2421 spinOffsetY->setClearValue( 0.0 );
2422 spinAngle->setClearValue( 0.0 );
2424 connect( spinWidth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2425 connect( spinHeight,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2427 connect( spinAngle,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2428 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2429 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2440 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2441 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2448#include <QAbstractListModel>
2449#include <QPixmapCache>
2461 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2462 QColor defaultFill, defaultStroke;
2463 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2464 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2465 QgsApplication::svgCache()->
containsParams( layer->
path(), hasFillParam, hasDefaultFillColor, defaultFill, hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity, hasStrokeParam, hasDefaultStrokeColor, defaultStroke, hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth, hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2466 mChangeColorButton->setEnabled( hasFillParam );
2467 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2468 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2469 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2470 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2475 const double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2476 if ( hasDefaultFillColor && !skipDefaultColors )
2480 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2481 mChangeColorButton->setColor( fill );
2483 if ( hasStrokeParam )
2486 const double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2487 if ( hasDefaultStrokeColor && !skipDefaultColors )
2489 stroke = defaultStroke;
2491 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2492 mChangeStrokeColorButton->setColor( stroke );
2495 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( layer->
path() );
2497 mStrokeWidthSpinBox->blockSignals(
true );
2498 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2499 mStrokeWidthSpinBox->blockSignals(
false );
2502 spinHeight->blockSignals(
true );
2503 if ( preservedAspectRatio )
2512 spinHeight->blockSignals(
false );
2513 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2516void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2518 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1; i >= 0; --i )
2520 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2522 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2525 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2536 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2543 mSvgSelectorWidget->setSvgPath(
mLayer->
path() );
2546 spinWidth->blockSignals(
true );
2548 spinWidth->blockSignals(
false );
2549 spinAngle->blockSignals(
true );
2551 spinAngle->blockSignals(
false );
2554 spinOffsetX->blockSignals(
true );
2556 spinOffsetX->blockSignals(
false );
2557 spinOffsetY->blockSignals(
true );
2559 spinOffsetY->blockSignals(
false );
2561 mSizeUnitWidget->blockSignals(
true );
2564 mSizeUnitWidget->blockSignals(
false );
2565 mStrokeWidthUnitWidget->blockSignals(
true );
2568 mStrokeWidthUnitWidget->blockSignals(
false );
2569 mOffsetUnitWidget->blockSignals(
true );
2572 mOffsetUnitWidget->blockSignals(
false );
2575 mHorizontalAnchorComboBox->blockSignals(
true );
2576 mVerticalAnchorComboBox->blockSignals(
true );
2579 mHorizontalAnchorComboBox->blockSignals(
false );
2580 mVerticalAnchorComboBox->blockSignals(
false );
2596 updateAssistantSymbol();
2613 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2622 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2628void QgsSvgMarkerSymbolLayerWidget::setWidth()
2631 double fixedAspectRatio = 0.0;
2632 spinHeight->blockSignals(
true );
2633 if ( defaultAspectRatio <= 0.0 )
2635 spinHeight->setValue( spinWidth->value() );
2637 else if ( mLockAspectRatio->locked() )
2639 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2643 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2645 spinHeight->blockSignals(
false );
2651void QgsSvgMarkerSymbolLayerWidget::setHeight()
2654 double fixedAspectRatio = 0.0;
2655 spinWidth->blockSignals(
true );
2656 if ( defaultAspectRatio <= 0.0 )
2658 spinWidth->setValue( spinHeight->value() );
2660 else if ( mLockAspectRatio->locked() )
2662 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2666 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2668 spinWidth->blockSignals(
false );
2674void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2678 if ( defaultAspectRatio <= 0.0 )
2694void QgsSvgMarkerSymbolLayerWidget::setAngle()
2700void QgsSvgMarkerSymbolLayerWidget::setOffset()
2702 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2706void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2713void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2724void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2735void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2744void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2754void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2764void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2774void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2783void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2800 mSvgSelectorWidget->setAllowParameters(
true );
2801 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2803 connect( mTextureWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2805 connect( mRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2807 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2808 connect( mStrokeWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2814 mRotationSpinBox->setClearValue( 0.0 );
2816 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2817 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2818 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2819 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2821 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2822 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2835 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2844 mTextureWidthSpinBox->blockSignals(
true );
2845 mTextureWidthSpinBox->setValue( width );
2846 mTextureWidthSpinBox->blockSignals(
false );
2848 mRotationSpinBox->blockSignals(
true );
2850 mRotationSpinBox->blockSignals(
false );
2851 mTextureWidthUnitWidget->blockSignals(
true );
2854 mTextureWidthUnitWidget->blockSignals(
false );
2855 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2858 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2859 mChangeColorButton->blockSignals(
true );
2861 mChangeColorButton->blockSignals(
false );
2862 mChangeStrokeColorButton->blockSignals(
true );
2864 mChangeStrokeColorButton->blockSignals(
false );
2865 mStrokeWidthSpinBox->blockSignals(
true );
2867 mStrokeWidthSpinBox->blockSignals(
false );
2891void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2900void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2912void QgsSVGFillSymbolLayerWidget::setFile(
const QString &name )
2915 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2921void QgsSVGFillSymbolLayerWidget::setSvgParameters(
const QMap<QString, QgsProperty> ¶meters )
2924 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2931void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2943 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2944 QColor defaultFill, defaultStroke;
2945 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2946 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2947 QgsApplication::svgCache()->
containsParams( mSvgSelectorWidget->sourceLineEdit()->source(), hasFillParam, hasDefaultFillColor, defaultFill, hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity, hasStrokeParam, hasDefaultStrokeColor, defaultStroke, hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth, hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2950 QColor fill = mChangeColorButton->color();
2951 const double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2952 if ( hasDefaultFillColor )
2956 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2957 mChangeColorButton->setColor( fill );
2959 mChangeColorButton->setEnabled( hasFillParam );
2960 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2963 QColor stroke = mChangeStrokeColorButton->color();
2964 const double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2965 if ( hasDefaultStrokeColor )
2967 stroke = defaultStroke;
2969 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2970 mChangeStrokeColorButton->setColor( stroke );
2972 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2973 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2974 if ( hasDefaultStrokeWidth && resetValues )
2976 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2978 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2981void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2992void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
3003void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3012void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
3022void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
3038 connect( mAngleSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
3039 connect( mDistanceSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
3040 connect( mOffsetSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
3045 mOffsetSpinBox->setClearValue( 0 );
3046 mAngleSpinBox->setClearValue( 0 );
3050 connect( mCoordinateReferenceComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
3061 connect( mClipModeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
3072 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3086 mDistanceUnitWidget->blockSignals(
true );
3089 mDistanceUnitWidget->blockSignals(
false );
3090 mOffsetUnitWidget->blockSignals(
true );
3093 mOffsetUnitWidget->blockSignals(
false );
3111void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3120void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3129void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3138void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3148void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3164 connect( mHorizontalDistanceSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3165 connect( mVerticalDistanceSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3166 connect( mHorizontalDisplacementSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3167 connect( mVerticalDisplacementSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3168 connect( mHorizontalOffsetSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3169 connect( mVerticalOffsetSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3170 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3171 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3172 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3173 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3174 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3175 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3187 connect( mClipModeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
3197 connect( mCoordinateReferenceComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
3205 mSeedSpinBox->setShowClearButton(
true );
3206 mSeedSpinBox->setClearValue( 0 );
3207 mRandomXSpinBox->setClearValue( 0 );
3208 mRandomYSpinBox->setClearValue( 0 );
3212 connect( mRandomXSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double d ) {
3219 connect( mRandomYSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double d ) {
3242 connect( mSeedSpinBox, qOverload<int>( &QSpinBox::valueChanged ),
this, [=](
int v ) {
3250 mAngleSpinBox->setShowClearButton(
true );
3251 mAngleSpinBox->setClearValue( 0 );
3252 connect( mAngleSpinBox, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double d ) {
3263 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3277 mHorizontalDistanceUnitWidget->blockSignals(
true );
3280 mHorizontalDistanceUnitWidget->blockSignals(
false );
3281 mVerticalDistanceUnitWidget->blockSignals(
true );
3284 mVerticalDistanceUnitWidget->blockSignals(
false );
3285 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3288 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3289 mVerticalDisplacementUnitWidget->blockSignals(
true );
3292 mVerticalDisplacementUnitWidget->blockSignals(
false );
3293 mHorizontalOffsetUnitWidget->blockSignals(
true );
3296 mHorizontalOffsetUnitWidget->blockSignals(
false );
3297 mVerticalOffsetUnitWidget->blockSignals(
true );
3300 mVerticalOffsetUnitWidget->blockSignals(
false );
3332void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3341void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3350void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3359void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3368void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3377void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3386void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3396void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3406void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3416void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3426void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3436void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3457 connect( mStrokeWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3458 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3459 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3466 scrollArea->setVerticalOnly(
true );
3468 btnColor->setAllowOpacity(
true );
3469 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3470 btnColor->setContext( QStringLiteral(
"symbology" ) );
3471 btnStrokeColor->setAllowOpacity(
true );
3472 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3473 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3475 mColorDDBtn->registerLinkedWidget( btnColor );
3476 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3478 spinOffsetX->setClearValue( 0.0 );
3479 spinOffsetY->setClearValue( 0.0 );
3480 spinAngle->setClearValue( 0.0 );
3486 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3489 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3491 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3494 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3496 connect( spinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3497 connect( spinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3508 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3517 mFontStyleComboBox->blockSignals(
true );
3518 populateFontStyleComboBox();
3519 mFontStyleComboBox->blockSignals(
false );
3537 mCharPreview->
setFont( mRefFont );
3543 mSizeUnitWidget->blockSignals(
true );
3546 mSizeUnitWidget->blockSignals(
false );
3548 mStrokeWidthUnitWidget->blockSignals(
true );
3551 mStrokeWidthUnitWidget->blockSignals(
false );
3553 mOffsetUnitWidget->blockSignals(
true );
3556 mOffsetUnitWidget->blockSignals(
false );
3577 updateAssistantSymbol();
3592 mCharPreview->setFont( mRefFont );
3593 populateFontStyleComboBox();
3598void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3605 mCharPreview->setFont( mRefFont );
3637 mCharPreview->setText( text );
3639 if ( text.isEmpty() )
3643 QString character = text;
3644 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3647 const unsigned int value = text.toUInt( &ok, 0 );
3650 character = QChar( value );
3651 mCharPreview->setText( character );
3672 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3674 mCharLineEdit->insert( chr );
3680 mCharPreview->setText( chr );
3684void QgsFontMarkerSymbolLayerWidget::setOffset()
3686 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3690void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3696void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3706void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3716void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3726void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3728 mFontStyleComboBox->clear();
3729 const QStringList styles = mFontDB.styles( mRefFont.family() );
3730 const auto constStyles = styles;
3731 for (
const QString &style : constStyles )
3733 mFontStyleComboBox->addItem( style );
3736 QString targetStyle = mFontDB.styleString( mRefFont );
3737 if ( !styles.contains( targetStyle ) )
3740 targetStyle = QFontInfo( f ).styleName();
3741 mRefFont.setStyleName( targetStyle );
3744 const int stylIndx = mFontStyleComboBox->findText( targetStyle );
3745 if ( stylIndx > -1 )
3750 mFontStyleComboBox->setCurrentIndex( curIndx );
3753void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3756 setFontStyle( mFontStyleComboBox->currentText() );
3759void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3768void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3777void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3786void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3788 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1; i >= 0; --i )
3790 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3792 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3795 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3807 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3808 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3809 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3810 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3815 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3833void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3839void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3845void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3851void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3866 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3870 connect( mRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3872 connect( mWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3873 connect( mHeightSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3879 mSpinOffsetX->setClearValue( 0.0 );
3880 mSpinOffsetY->setClearValue( 0.0 );
3881 mRotationSpinBox->setClearValue( 0.0 );
3883 connect( mSpinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3884 connect( mSpinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3887 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3888 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3898 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3909 mHeightSpinBox->blockSignals(
true );
3910 if ( preservedAspectRatio )
3919 mHeightSpinBox->blockSignals(
false );
3920 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3928 mSizeUnitWidget->blockSignals(
true );
3931 mSizeUnitWidget->blockSignals(
false );
3932 mOffsetUnitWidget->blockSignals(
true );
3935 mOffsetUnitWidget->blockSignals(
false );
3950 updatePreviewImage();
3964void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3967 updatePreviewImage();
3971void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3973 bool fitsInCache =
false;
3975 if ( image.isNull() )
3977 mLabelImagePreview->setPixmap( QPixmap() );
3981 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3982 previewImage.fill( Qt::transparent );
3983 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3985 p.begin( &previewImage );
3987 uchar pixDataRGB[] = { 150, 150, 150, 150, 100, 100, 100, 150, 100, 100, 100, 150, 150, 150, 150, 150 };
3988 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3989 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3990 QBrush checkerBrush;
3991 checkerBrush.setTexture( pix );
3992 p.fillRect( imageRect, checkerBrush );
3999 p.drawImage( imageRect.left(), imageRect.top(), image );
4001 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4004void QgsRasterMarkerSymbolLayerWidget::setWidth()
4007 double fixedAspectRatio = 0.0;
4008 mHeightSpinBox->blockSignals(
true );
4009 if ( defaultAspectRatio <= 0.0 )
4011 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4013 else if ( mLockAspectRatio->locked() )
4015 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4019 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4021 mHeightSpinBox->blockSignals(
false );
4027void QgsRasterMarkerSymbolLayerWidget::setHeight()
4030 double fixedAspectRatio = 0.0;
4031 mWidthSpinBox->blockSignals(
true );
4032 if ( defaultAspectRatio <= 0.0 )
4034 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4036 else if ( mLockAspectRatio->locked() )
4038 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4042 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4044 mWidthSpinBox->blockSignals(
false );
4050void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4053 if ( defaultAspectRatio <= 0.0 )
4068void QgsRasterMarkerSymbolLayerWidget::setAngle()
4074void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
4078 updatePreviewImage();
4081void QgsRasterMarkerSymbolLayerWidget::setOffset()
4083 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4087void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4097void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4107void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4116void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4135 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastAnimatedMarkerImageDir" ) );
4139 connect( mRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setAngle );
4141 connect( mWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setWidth );
4142 connect( mHeightSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setHeight );
4145 mFrameRateSpin->setClearValue( 10 );
4146 mFrameRateSpin->setShowClearButton(
true );
4147 connect( mFrameRateSpin, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double value ) {
4155 mSpinOffsetX->setClearValue( 0.0 );
4156 mSpinOffsetY->setClearValue( 0.0 );
4157 mRotationSpinBox->setClearValue( 0.0 );
4159 connect( mSpinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4160 connect( mSpinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4163 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
4164 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
4174 if ( layer->
layerType() != QLatin1String(
"AnimatedMarker" ) )
4184 if ( firstFrameTime > 0 )
4186 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4190 mFrameRateSpin->setClearValue( 10 );
4195 mHeightSpinBox->blockSignals(
true );
4196 if ( preservedAspectRatio )
4205 mHeightSpinBox->blockSignals(
false );
4206 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4216 mSizeUnitWidget->blockSignals(
true );
4219 mSizeUnitWidget->blockSignals(
false );
4220 mOffsetUnitWidget->blockSignals(
true );
4223 mOffsetUnitWidget->blockSignals(
false );
4238 updatePreviewImage();
4252void QgsAnimatedMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4257 if ( firstFrameTime > 0 )
4259 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4263 mFrameRateSpin->setClearValue( 10 );
4265 updatePreviewImage();
4269void QgsAnimatedMarkerSymbolLayerWidget::updatePreviewImage()
4271 if ( mPreviewMovie )
4273 mLabelImagePreview->setMovie(
nullptr );
4274 mPreviewMovie->deleteLater();
4275 mPreviewMovie =
nullptr;
4278 mPreviewMovie =
new QMovie(
mLayer->
path(), QByteArray(),
this );
4279 mPreviewMovie->setScaledSize( QSize( 150, 150 ) );
4280 mLabelImagePreview->setMovie( mPreviewMovie );
4281 mPreviewMovie->start();
4284void QgsAnimatedMarkerSymbolLayerWidget::setWidth()
4287 double fixedAspectRatio = 0.0;
4288 mHeightSpinBox->blockSignals(
true );
4289 if ( defaultAspectRatio <= 0.0 )
4291 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4293 else if ( mLockAspectRatio->locked() )
4295 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4299 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4301 mHeightSpinBox->blockSignals(
false );
4307void QgsAnimatedMarkerSymbolLayerWidget::setHeight()
4310 double fixedAspectRatio = 0.0;
4311 mWidthSpinBox->blockSignals(
true );
4312 if ( defaultAspectRatio <= 0.0 )
4314 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4316 else if ( mLockAspectRatio->locked() )
4318 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4322 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4324 mWidthSpinBox->blockSignals(
false );
4330void QgsAnimatedMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4333 if ( defaultAspectRatio <= 0.0 )
4348void QgsAnimatedMarkerSymbolLayerWidget::setAngle()
4354void QgsAnimatedMarkerSymbolLayerWidget::setOpacity(
double value )
4358 updatePreviewImage();
4361void QgsAnimatedMarkerSymbolLayerWidget::setOffset()
4363 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4367void QgsAnimatedMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4377void QgsAnimatedMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4387void QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4396void QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4413 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4417 connect( mRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
4428 connect( mWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=](
double d ) {
4437 connect( mHeightSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=](
double d ) {
4449 mSpinOffsetX->setClearValue( 0.0 );
4450 mSpinOffsetY->setClearValue( 0.0 );
4451 mRotationSpinBox->setClearValue( 0.0 );
4453 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4454 connect( mSpinOffsetX,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4455 connect( mSpinOffsetY,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4467 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4480 cboCoordinateMode->blockSignals(
true );
4484 cboCoordinateMode->setCurrentIndex( 1 );
4488 cboCoordinateMode->setCurrentIndex( 0 );
4491 cboCoordinateMode->blockSignals(
false );
4497 mOffsetUnitWidget->blockSignals(
true );
4500 mOffsetUnitWidget->blockSignals(
false );
4503 mSizeUnitWidget->blockSignals(
true );
4506 mSizeUnitWidget->blockSignals(
false );
4510 updatePreviewImage();
4525void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4528 updatePreviewImage();
4532void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4549void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4558 updatePreviewImage();
4561void QgsRasterFillSymbolLayerWidget::offsetChanged()
4563 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4567void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4578void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4587void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4589 bool fitsInCache =
false;
4591 if ( image.isNull() )
4593 mLabelImagePreview->setPixmap( QPixmap() );
4597 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4598 previewImage.fill( Qt::transparent );
4599 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4601 p.begin( &previewImage );
4603 uchar pixDataRGB[] = { 150, 150, 150, 150, 100, 100, 100, 150, 100, 100, 100, 150, 150, 150, 150, 150 };
4604 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4605 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4606 QBrush checkerBrush;
4607 checkerBrush.setTexture( pix );
4608 p.fillRect( imageRect, checkerBrush );
4615 p.drawImage( imageRect.left(), imageRect.top(), image );
4617 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4631 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4645 connect( spinWidth, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=] {
4663 spinOffset->setClearValue( 0.0 );
4664 connect( spinOffset, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double val ) {
4672 connect( cboCapStyle, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
4679 connect( cboJoinStyle, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
4692 updatePreviewImage();
4705 if ( layer->
layerType() != QLatin1String(
"RasterLine" ) )
4729 updatePreviewImage();
4744void QgsRasterLineSymbolLayerWidget::imageSourceChanged(
const QString &text )
4747 updatePreviewImage();
4751void QgsRasterLineSymbolLayerWidget::updatePreviewImage()
4753 bool fitsInCache =
false;
4755 if ( image.isNull() )
4757 mLabelImagePreview->setPixmap( QPixmap() );
4761 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4762 previewImage.fill( Qt::transparent );
4763 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4765 p.begin( &previewImage );
4767 uchar pixDataRGB[] = { 150, 150, 150, 150, 100, 100, 100, 150, 100, 100, 100, 150, 150, 150, 150, 150 };
4768 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4769 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4770 QBrush checkerBrush;
4771 checkerBrush.setTexture( pix );
4772 p.fillRect( imageRect, checkerBrush );
4779 p.drawImage( imageRect.left(), imageRect.top(), image );
4781 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4794 modificationExpressionSelector->setMultiLine(
true );
4795 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4796 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4802 mUnitWidget->setShowMapScaleButton(
false );
4805 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4807 if ( !mBlockSignals )
4809 mLayer->
setUnits( mUnitWidget->unit() );
4820 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData(
static_cast<int>( mLayer->
symbolType() ) ) );
4821 mUnitWidget->setUnit( mLayer->
units() );
4830void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4837void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4840 std::unique_ptr<QgsSymbol> subSymbol( mLayer->
subSymbol()->
clone() );
4855 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4858 layers << subSymbol->symbolLayer( i )->clone();
4861 if ( !layers.empty() )
4871 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4872 layers << subSymbol->symbolLayer( i )->clone();
4894 mPointCountSpinBox->setShowClearButton(
true );
4895 mPointCountSpinBox->setClearValue( 100 );
4896 mSeedSpinBox->setShowClearButton(
true );
4897 mSeedSpinBox->setClearValue( 0 );
4899 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
4900 connect( mPointCountSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
4901 connect( mDensityAreaSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
4902 connect( mSeedSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
4903 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [=](
bool checked ) {
4918 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
4928 bool showDensityBasedCountWidgets =
false;
4932 showDensityBasedCountWidgets =
true;
4937 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4938 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4939 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4940 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4942 whileBlocking( mCountMethodComboBox )->setCurrentIndex( mCountMethodComboBox->findData(
static_cast<int>( mLayer->
countMethod() ) ) );
4944 mDensityAreaUnitWidget->blockSignals(
true );
4947 mDensityAreaUnitWidget->blockSignals(
false );
4960void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
4962 bool showDensityBasedCountWidgets =
false;
4966 showDensityBasedCountWidgets =
true;
4971 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4972 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4973 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4974 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4983void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
4992void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
5001void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
5011void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
5030 btnColorRamp->setShowGradientOnly(
true );
5032 btnChangeColor->setAllowOpacity(
true );
5033 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5034 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
5035 btnChangeColor->setShowNoColor(
true );
5036 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
5037 btnChangeColor2->setAllowOpacity(
true );
5038 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5039 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
5040 btnChangeColor2->setShowNoColor(
true );
5041 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
5043 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
5044 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
5061 if ( btnColorRamp->isNull() )
5071 connect( radioTwoColor, &QAbstractButton::toggled,
this, [=] {
5074 if ( radioTwoColor->isChecked() )
5076 mLayer->setGradientColorType( Qgis::GradientColorSource::SimpleTwoColor );
5077 btnChangeColor->setEnabled( true );
5078 btnChangeColor2->setEnabled( true );
5079 btnColorRamp->setEnabled( false );
5083 mLayer->setGradientColorType( Qgis::GradientColorSource::ColorRamp );
5084 btnColorRamp->setEnabled( true );
5085 btnChangeColor->setEnabled( false );
5086 btnChangeColor2->setEnabled( false );
5104 connect( spinWidth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=] {
5121 spinOffset->setClearValue( 0.0 );
5122 connect( spinOffset, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double val ) {
5130 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [=] {
5137 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [=] {
5153 if ( layer->
layerType() != QLatin1String(
"Lineburst" ) )
5164 btnChangeColor->blockSignals(
true );
5166 btnChangeColor->blockSignals(
false );
5167 btnChangeColor2->blockSignals(
true );
5169 btnChangeColor2->blockSignals(
false );
5173 radioTwoColor->setChecked(
true );
5174 btnColorRamp->setEnabled(
false );
5178 radioColorRamp->setChecked(
true );
5179 btnChangeColor->setEnabled(
false );
5180 btnChangeColor2->setEnabled(
false );
5186 btnColorRamp->blockSignals(
true );
5188 btnColorRamp->blockSignals(
false );
5237 connect( spinWidth,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, [=] {
5240 mLayer->
setWidth( spinWidth->value() );
5254 spinOffset->setClearValue( 0.0 );
5255 connect( spinOffset, qOverload<double>( &QDoubleSpinBox::valueChanged ),
this, [=](
double val ) {
5263 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [=] {
5270 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [=] {
5288 if ( layer->
layerType() != QLatin1String(
"FilledLine" ) )
5341 mSpinSkipMultiples->setClearValue( 0, tr(
"Not set" ) );
5342 mSpinLabelOffsetX->setClearValue( 0 );
5343 mSpinLabelOffsetY->setClearValue( 0 );
5344 mSpinAverageAngleLength->setClearValue( 4.0 );
5348 connect( mComboQuantity, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
5349 if ( mLayer && !mBlockChangesSignal )
5356 if ( mLayer && !mBlockChangesSignal )
5362 connect( spinInterval, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, [=] {
5363 if ( mLayer && !mBlockChangesSignal )
5369 connect( mSpinSkipMultiples, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, [=] {
5370 if ( mLayer && !mBlockChangesSignal )
5376 connect( mCheckRotate, &QCheckBox::toggled,
this, [=](
bool checked ) {
5377 if ( mLayer && !mBlockChangesSignal )
5382 mSpinAverageAngleLength->setEnabled( checked );
5383 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
5385 connect( mCheckShowMarker, &QCheckBox::toggled,
this, [=](
bool checked ) {
5386 if ( mLayer && !mBlockChangesSignal )
5393 connect( mSpinLabelOffsetX, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, [=] {
5394 if ( mLayer && !mBlockChangesSignal )
5396 mLayer->
setLabelOffset( QPointF( mSpinLabelOffsetX->value(), mSpinLabelOffsetY->value() ) );
5400 connect( mSpinLabelOffsetY, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, [=] {
5401 if ( mLayer && !mBlockChangesSignal )
5403 mLayer->
setLabelOffset( QPointF( mSpinLabelOffsetX->value(), mSpinLabelOffsetY->value() ) );
5408 if ( mLayer && !mBlockChangesSignal )
5416 connect( mComboPlacement, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [=] {
5417 if ( mLayer && !mBlockChangesSignal )
5421 switch ( placement )
5426 mIntervalWidget->show();
5429 mIntervalWidget->hide();
5436 connect( mSpinAverageAngleLength, qOverload<double>( &QgsDoubleSpinBox::valueChanged ),
this, [=] {
5437 if ( mLayer && !mBlockChangesSignal )
5444 if ( mLayer && !mBlockChangesSignal )
5452 connect( mNumberFormatPushButton, &QPushButton::clicked,
this, &QgsLinearReferencingSymbolLayerWidget::changeNumberFormat );
5454 mTextFormatButton->registerExpressionContextGenerator(
this );
5462 if ( !layer || layer->
layerType() != QLatin1String(
"LinearReferencing" ) )
5466 mLayer = qgis::down_cast<QgsLinearReferencingSymbolLayer *>( layer );
5468 mBlockChangesSignal =
true;
5470 mComboPlacement->setCurrentIndex( mComboPlacement->findData( QVariant::fromValue( mLayer->
placement() ) ) );
5476 mIntervalWidget->show();
5479 mIntervalWidget->hide();
5483 mComboQuantity->setCurrentIndex( mComboQuantity->findData( QVariant::fromValue( mLayer->
labelSource() ) ) );
5485 mTextFormatButton->setTextFormat( mLayer->
textFormat() );
5486 spinInterval->setValue( mLayer->
interval() );
5489 mCheckShowMarker->setChecked( mLayer->
showMarker() );
5490 mSpinLabelOffsetX->setValue( mLayer->
labelOffset().x() );
5491 mSpinLabelOffsetY->setValue( mLayer->
labelOffset().y() );
5499 mSpinAverageAngleLength->setEnabled( mCheckRotate->isChecked() );
5500 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
5507 mBlockChangesSignal =
false;
5522void QgsLinearReferencingSymbolLayerWidget::changeNumberFormat()
5532 if ( !mBlockChangesSignal )
5544 dialog.registerExpressionContextGenerator(
this );
5545 if ( dialog.exec() )
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
@ InnerVertices
Inner vertices (i.e. all vertices except the first and last vertex)
@ LastVertex
Place symbols on the last vertex in the line.
@ CentralPoint
Place symbols at the mid point of the line.
@ SegmentCenter
Place symbols at the center of every line segment.
@ Vertex
Place symbols on every vertex in the line.
@ Interval
Place symbols at regular intervals.
@ FirstVertex
Place symbols on the first vertex in the line.
MarkerClipMode
Marker clipping modes.
@ CompletelyWithin
Render complete markers wherever the completely fall within the polygon shape.
@ NoClipping
No clipping, render complete markers.
@ Shape
Clip to polygon shape.
@ CentroidWithin
Render complete markers wherever their centroid falls within the polygon shape.
LineClipMode
Line clipping modes.
@ NoClipping
Lines are not clipped, will extend to shape's bounding box.
@ ClipPainterOnly
Applying clipping on the painter only (i.e. line endpoints will coincide with polygon bounding box,...
@ ClipToIntersection
Clip lines to intersection with polygon shape (slower) (i.e. line endpoints will coincide with polygo...
@ ColorRamp
Gradient color ramp.
@ SimpleTwoColor
Simple two color gradient.
@ Reflect
Reflect gradient.
@ Pad
Pad out gradient using colors at endpoint of gradient.
PointCountMethod
Methods which define the number of points randomly filling a polygon.
@ Absolute
The point count is used as an absolute count of markers.
@ DensityBased
The point count is part of a marker density count.
MarkerShape
Marker shapes.
LinearReferencingPlacement
Defines how/where the labels should be placed in a linear referencing symbol layer.
@ IntervalZ
Place labels at regular intervals, linearly interpolated using Z values.
@ Vertex
Place labels on every vertex in the line.
@ IntervalM
Place labels at regular intervals, linearly interpolated using M values.
@ IntervalCartesian2D
Place labels at regular intervals, using Cartesian distance calculations on a 2D plane.
LinearReferencingLabelSource
Defines what quantity to use for the labels shown in a linear referencing symbol layer.
@ CartesianDistance2D
Distance along line, calculated using Cartesian calculations on a 2D plane.
@ Percentage
Percentage of another measurement (e.g., canvas size, feature size)
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
@ Conical
Conical (polar) gradient.
@ Radial
Radial (circular) gradient.
SymbolCoordinateReference
Symbol coordinate reference modes.
@ Feature
Relative to feature/shape being rendered.
@ Viewport
Relative to the whole viewport/output device.
QFlags< MarkerLinePlacement > MarkerLinePlacements
static const double UI_SCALE_FACTOR
UI scaling factor.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
void sourceChanged(const QString &source)
Emitted whenever the file source is changed in the widget.
Animated marker symbol layer class.
void setFrameRate(double rate)
Sets the marker frame rate in frame per second.
double frameRate() const
Returns the marker frame rate in frame per second.
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 nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
bool exists(const QgsPropertyDefinition &definition) const
Returns true if the property is stored in the layer already, false otherwise.
A fill symbol layer which renders a marker symbol at the centroid of a polygon geometry.
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool pointOnSurface() const
void setClipOnCurrentPartOnly(bool clipOnCurrentPartOnly)
Sets whether point markers should be clipped to the current part boundary only.
void setClipPoints(bool clipPoints)
Sets whether point markers should be clipped to the polygon boundary.
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
bool clipOnCurrentPartOnly() const
Returns true if point markers should be clipped to the current part boundary only.
void setPointOnSurface(bool pointOnSurface)
Abstract base class for color ramps.
A dialog to enter a custom dash space pattern for lines.
Single scope for storing variables and functions for use within a QgsExpressionContext.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
static const QString EXPR_CLUSTER_SIZE
Inbuilt variable name for cluster size variable.
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
static const QString EXPR_GEOMETRY_RING_NUM
Inbuilt variable name for geometry ring number variable.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
QgsExpressionContextScope * lastScope()
Returns the last scope added to the context.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
bool hasVariable(const QString &name) const
Check whether a variable is specified by any scope within the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
static const QString EXPR_CLUSTER_COLOR
Inbuilt variable name for cluster color variable.
void expressionChanged(const QString &expression)
Emitted when the expression is changed.
double angle() const
Returns the rotation angle of the fill symbol, in degrees clockwise.
void setAngle(double angle)
Sets the rotation angle of the pattern, in degrees clockwise.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol layer type which fills a stroked line with a QgsFillSymbol.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
void setMapUnitScale(const QgsMapUnitScale &scale) override
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
QgsFilledMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the stroke width unit.
void setStrokeColor(const QColor &color) override
Sets the stroke color for the symbol layer.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
Qgis::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
double strokeWidth() const
Returns the marker's stroke width.
void setFontStyle(const QString &style)
Sets the font style for the font which will be used to render the point.
QString fontStyle() const
Returns the font style for the associated font which will be used to render the point.
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point.
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
void setStrokeWidth(double width)
Set's the marker's stroke width.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
QgsFontMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
QString character() const
Returns the character(s) used when rendering points.
static QString translateNamedStyle(const QString &namedStyle)
Returns the localized named style of a font, if such a translation is available.
static QString untranslateNamedStyle(const QString &namedStyle)
Returns the english named style of a font, if possible.
static QFont createFont(const QString &family, int pointSize=-1, int weight=-1, bool italic=false)
Creates a font with the specified family.
static bool updateFontViaStyle(QFont &f, const QString &fontstyle, bool fallback=false)
Updates font with named style and retain all font properties.
static void setFontFamily(QFont &font, const QString &family)
Sets the family for a font object.
A symbol layer subclass which alters rendered feature shapes through the use of QGIS expressions.
Qgis::RenderUnit units() const
Returns the unit for the geometry expression.
QString geometryExpression() const
Gets the expression to generate this geometry.
void setUnits(Qgis::RenderUnit units)
Sets the units for the geometry expression.
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
void setSymbolType(Qgis::SymbolType symbolType)
Set the type of symbol which should be created.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
Qgis::SymbolType symbolType() const
Access the symbol type.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
A fill symbol layer which draws a smooth color gradient over a polygon.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient fill.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
void setGradientSpread(Qgis::GradientSpread gradientSpread)
Sets the gradient spread mode, which controls how the gradient behaves outside of the predefined stop...
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
Qgis::SymbolCoordinateReference coordinateMode() const
Returns the coordinate mode for gradient, which controls how the gradient stops are positioned.
bool referencePoint2IsCentroid() const
Returns whether the end point for the gradient is taken from the feature centroid.
void setGradientType(Qgis::GradientType gradientType)
Sets the type of gradient, e.g., linear or radial.
void setReferencePoint2(QPointF referencePoint)
Sets the end point of gradient fill, in the range [0,0] - [1,1].
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void setCoordinateMode(Qgis::SymbolCoordinateReference coordinateMode)
Sets the coordinate mode for gradient, which controls how the gradient stops are positioned.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets whether the end point for the gradient is taken from the feature centroid.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets whether the starting point for the gradient is taken from the feature centroid.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setGradientColorType(Qgis::GradientColorSource gradientColorType)
Sets the gradient color mode, which controls how gradient color stops are created.
QPointF referencePoint1() const
Returns the starting point of gradient fill, in the range [0,0] - [1,1].
Qgis::GradientSpread gradientSpread() const
Returns the gradient spread mode, which controls how the gradient behaves outside of the predefined s...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setReferencePoint1(QPointF referencePoint)
Sets the starting point of gradient fill, in the range [0,0] - [1,1].
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::GradientType gradientType() const
Returns the type of gradient, e.g., linear or radial.
bool referencePoint1IsCentroid() const
Returns whether the starting point for the gradient is taken from the feature centroid.
QPointF referencePoint2() const
Returns the end point of gradient fill, in the range [0,0] - [1,1].
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
Line symbol layer type which draws repeating line sections along a line feature.
void setHashLength(double length)
Sets the length of hash symbols.
double hashAngle() const
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Qgis::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
double hashLength() const
Returns the length of hash symbols.
void setHashLengthUnit(Qgis::RenderUnit unit)
Sets the unit for the length of hash symbols.
void setHashAngle(double angle)
Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.
static QIcon iconLine()
Returns an icon representing line geometries.
static QIcon iconPolygon()
Returns an icon representing polygon geometries.
static QIcon iconPoint()
Returns an icon representing point geometries.
int nextFrameDelay(const QString &path, int currentFrame=0, bool blocking=false)
For image formats that support animation, this function returns the number of milliseconds to wait un...
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false, double targetDpi=96, int frameNumber=-1, bool *isMissing=nullptr)
Returns the specified path rendered as an image.
Qgis::SymbolCoordinateReference coordinateReference() const
Returns the coordinate reference mode for fill which controls how the top left corner of the image fi...
void setCoordinateReference(Qgis::SymbolCoordinateReference coordinateReference)
Sets the coordinate reference mode for fill which controls how the top left corner of the image fill ...
A symbol fill consisting of repeated parallel lines.
Qgis::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
Qgis::LineClipMode clipMode() const
Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
void setClipMode(Qgis::LineClipMode mode)
Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line pattern's offset.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
double distance() const
Returns the distance between lines in the fill pattern.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
Qgis::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
Abstract base class for line symbol layers.
const QgsMapUnitScale & widthMapUnitScale() const
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
@ ExteriorRingOnly
Render the exterior ring only.
@ InteriorRingsOnly
Render the interior rings only.
@ AllRings
Render both exterior and interior rings.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setOffset(double offset)
Sets the line's offset.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line's offset.
void setWidthUnit(Qgis::RenderUnit unit)
Sets the units for the line's width.
virtual double width() const
Returns the estimated width for the line symbol layer.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
double offset() const
Returns the line's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
Qgis::RenderUnit offsetUnit() const
Returns the units for the line's offset.
Qgis::RenderUnit widthUnit() const
Returns the units for the line's width.
A line symbol type, for rendering LineString and MultiLineString geometries.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual la...
void setShowMarker(bool show)
Sets whether a marker symbol should be shown corresponding to the labeled point on line.
void setAverageAngleUnit(Qgis::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
void setSkipMultiplesOf(double multiple)
Sets the multiple distance to skip labels for.
Qgis::RenderUnit labelOffsetUnit() const
Returns the unit used for the offset between the line and linear referencing labels.
void setLabelOffset(const QPointF &offset)
Sets the offset between the line and linear referencing labels.
QgsTextFormat textFormat() const
Returns the text format used to render the layer.
bool rotateLabels() const
Returns true if the labels and symbols are to be rotated to match their line segment orientation.
bool showMarker() const
Returns true if a marker symbol should be shown corresponding to the labeled point on line.
void setNumericFormat(QgsNumericFormat *format)
Sets the numeric format used to format the labels for the layer.
QgsNumericFormat * numericFormat() const
Returns the numeric format used to format the labels for the layer.
QPointF labelOffset() const
Returns the offset between the line and linear referencing labels.
const QgsMapUnitScale & labelOffsetMapUnitScale() const
Returns the map unit scale used for calculating the offset between the line and linear referencing la...
void setInterval(double interval)
Sets the interval between labels.
void setLabelSource(Qgis::LinearReferencingLabelSource source)
Sets the label source, which dictates what quantity to use for the labels shown.
Qgis::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
void setRotateLabels(bool rotate)
Sets whether the labels and symbols should be rotated to match their line segment orientation.
void setTextFormat(const QgsTextFormat &format)
Sets the text format used to render the layer.
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
void setLabelOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset between the line and linear referencing label...
void setLabelOffsetUnit(Qgis::RenderUnit unit)
Sets the unit used for the offset between the line and linear referencing labels.
Qgis::LinearReferencingLabelSource labelSource() const
Returns the label source, which dictates what quantity to use for the labels shown.
double skipMultiplesOf() const
Returns the multiple distance to skip labels for.
void setPlacement(Qgis::LinearReferencingPlacement placement)
Sets the placement mode for the labels.
double interval() const
Returns the interval between labels.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual label...
Qgis::LinearReferencingPlacement placement() const
Returns the placement mode for the labels.
Line symbol layer type which draws a gradient pattern perpendicularly along a line.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient line.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient line.
Struct for storing maximum and minimum scales for measurements in map units.
Line symbol layer type which draws repeating marker symbols along a line feature.
virtual void setSize(double size)
Sets the symbol size.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's offset.
void setAngle(double angle)
Sets the rotation angle for the marker.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
double size() const
Returns the symbol size.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
Qgis::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
Qgis::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's size.
VerticalAnchorPoint
Symbol vertical anchor points.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
A marker symbol type, for rendering Point and MultiPoint geometries.
A dialog to create a new auxiliary field.
A dialog to create a new auxiliary layer.
A fill symbol layer which fills polygon shapes with repeating marker symbols.
const QgsMapUnitScale & distanceYMapUnitScale() const
Returns the map unit scale for the vertical distance between points in the pattern.
void setDisplacementX(double d)
Sets the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
Qgis::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationXMapUnitScale() const
Returns the unit scale for the horizontal random deviation of points in the pattern.
void setOffsetX(double offset)
Sets the horizontal offset values for points in the pattern.
double maximumRandomDeviationY() const
Returns the maximum vertical random deviation of points in the pattern.
void setDistanceYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical distance between points in the pattern.
double distanceX() const
Returns the horizontal distance between rendered markers in the fill.
Qgis::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of points in the pattern.
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
void setDisplacementYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setRandomDeviationYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical random deviation of points in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
Returns the map unit scale for the horizontal distance between points in the pattern.
void setRandomDeviationYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical random deviation of points in the pattern.
unsigned long seed() const
Returns the random number seed to use when randomly shifting points, or 0 if a truly random sequence ...
Qgis::MarkerClipMode clipMode() const
Returns the marker clipping mode, which defines how markers are clipped at the edges of shapes.
void setRandomDeviationXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal random deviation of points in the pattern.
Qgis::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
double offsetY() const
Returns the vertical offset values for points in the pattern.
void setDisplacementY(double d)
Sets the vertical displacement for odd numbered columns in the pattern.
void setMaximumRandomDeviationX(double deviation)
Sets the maximum horizontal random deviation of points in the pattern.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setSeed(unsigned long seed)
Sets the random number seed to use when randomly shifting points, or 0 if a truly random sequence wil...
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal offset for rows in the pattern.
const QgsMapUnitScale & displacementXMapUnitScale() const
Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal distance between points in the pattern.
Qgis::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
const QgsMapUnitScale & displacementYMapUnitScale() const
Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setDistanceXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal distance between points in the pattern.
void setOffsetYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationYMapUnitScale() const
Returns the unit scale for the vertical random deviation of points in the pattern.
Qgis::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setDistanceY(double d)
Sets the vertical distance between rendered markers in the fill.
Qgis::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
Qgis::RenderUnit randomDeviationXUnit() const
Returns the units for the horizontal random deviation of points in the pattern.
void setDisplacementXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDistanceX(double d)
Sets the horizontal distance between rendered markers in the fill.
double offsetX() const
Returns the horizontal offset values for points in the pattern.
void setRandomDeviationXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal random deviation of points in the pattern.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
void setMaximumRandomDeviationY(double deviation)
Sets the maximum vertical random deviation of points in the pattern.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical distance between points in the pattern.
Qgis::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
double displacementX() const
Returns the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
double distanceY() const
Returns the vertical distance between rendered markers in the fill.
void setClipMode(Qgis::MarkerClipMode mode)
Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.
QgsProperty property(int key) const final
Returns a matching property from the collection, if one exists.
Definition for a property.
A store for object properties.
void setField(const QString &field)
Sets the field name the property references.
A fill symbol layer which places markers at random locations within polygons.
int pointCount() const
Returns the count of random points to render in the fill.
unsigned long seed() const
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be...
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setCountMethod(Qgis::PointCountMethod method)
Sets the count method used to randomly fill the polygon.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
void setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
void setPointCount(int count)
Sets the count of random points to render in the fill.
Qgis::RenderUnit densityAreaUnit() const
Returns the units for the density area.
Qgis::PointCountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
void setDensityAreaUnit(Qgis::RenderUnit unit)
Sets the units for the density area.
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
double densityArea() const
Returns the density area used to count the number of points to randomly fill the polygon.
void setDensityArea(double area)
Sets the density area used to count the number of points to randomly fill the polygon.
A class for filling symbols with a repeated raster image.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the image's width and height.
double width() const
Returns the width used for scaling the image used in the fill.
void setOffsetUnit(const Qgis::RenderUnit unit)
Sets the units for the fill's offset.
void setHeight(double height)
Sets the height for scaling the image.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
double opacity() const
Returns the opacity for the raster image used in the fill.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the unit for the image's width and height.
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
Qgis::RenderUnit sizeUnit() const
Returns the units for the image's width and height.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QString imageFilePath() const
The path to the raster image used for the fill.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
double height() const
Returns the height used for scaling the image used in the fill.
void setWidth(double width)
Sets the width for scaling the image used in the fill.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width and height.
QPointF offset() const
Returns the offset for the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setOffset(QPointF offset)
Sets the offset for the fill.
void setCoordinateMode(Qgis::SymbolCoordinateReference mode)
Set the coordinate mode for fill.
Line symbol layer type which draws line sections using a raster image file.
double opacity() const
Returns the line opacity.
QString path() const
Returns the raster image path.
void setPath(const QString &path)
Set the raster image path.
void setOpacity(double opacity)
Set the line opacity.
Raster marker symbol layer class.
void setOpacity(double opacity)
Set the marker opacity.
QString path() const
Returns the marker raster image path.
void setPath(const QString &path)
Set the marker raster image path.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
double opacity() const
Returns the marker opacity.
A class for filling symbols with a repeated SVG file.
void setParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the dynamic SVG parameters.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setSvgStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the stroke width.
Qgis::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
void setPatternWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
void setSvgFilePath(const QString &svgPath)
Sets the path to the SVG file to render in the fill.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
Qgis::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
Stores properties relating to a screen.
Qgis::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
Qgis::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
QPointF offset() const
Returns the offset for the shapeburst fill.
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
const QgsMapUnitScale & offsetMapUnitScale() const
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setColorType(Qgis::GradientColorSource colorType)
Sets the color mode to use for the shapeburst fill.
Qgis::GradientColorSource colorType() const
Returns the color mode used for the shapeburst fill.
const QgsMapUnitScale & distanceMapUnitScale() const
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
Renders polygons using a single fill and stroke color.
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
Qt::PenJoinStyle penJoinStyle() const
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setBrushStyle(Qt::BrushStyle style)
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the width of the fill's stroke.
void setPenJoinStyle(Qt::PenJoinStyle style)
Qt::PenStyle strokeStyle() const
double strokeWidth() const
void setStrokeWidth(double strokeWidth)
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setStrokeStyle(Qt::PenStyle strokeStyle)
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setStrokeColor(const QColor &strokeColor) override
Sets the stroke color for the symbol layer.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qt::BrushStyle brushStyle() const
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
bool tweakDashPatternOnCorners() const
Returns true if dash patterns tweaks should be applied on sharp corners, to ensure that a double-leng...
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
const QgsMapUnitScale & trimDistanceEndMapUnitScale() const
Returns the map unit scale for the trim distance for the end of the line.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
const QgsMapUnitScale & trimDistanceStartMapUnitScale() const
Returns the map unit scale for the trim distance for the start of the line.
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for lengths used in the custom dash pattern.
void setTrimDistanceEndMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the end of the line.
void setTrimDistanceEnd(double distance)
Sets the trim distance for the end of the line, which dictates a length from the end of the line at w...
double trimDistanceStart() const
Returns the trim distance for the start of the line, which dictates a length from the start of the li...
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
void setTweakDashPatternOnCorners(bool enabled)
Sets whether dash patterns tweaks should be applied on sharp corners, to ensure that a double-length ...
Qgis::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
double trimDistanceEnd() const
Returns the trim distance for the end of the line, which dictates a length from the end of the line a...
Qgis::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
const QgsMapUnitScale & dashPatternOffsetMapUnitScale() const
Returns the map unit scale for the dash pattern offset value.
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
void setDashPatternOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the dash pattern offset.
QgsSimpleLineSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
double dashPatternOffset() const
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should sta...
void setAlignDashPattern(bool enabled)
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks...
void setTrimDistanceStartMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the start of the line.
Qgis::RenderUnit trimDistanceStartUnit() const
Returns the unit for the trim distance for the start of the line.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
void setTrimDistanceEndUnit(Qgis::RenderUnit unit)
Sets the unit for the trim distance for the end of the line.
void setDashPatternOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the dash pattern offset.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setTrimDistanceStart(double distance)
Sets the trim distance for the start of the line, which dictates a length from the start of the line ...
void setTrimDistanceStartUnit(Qgis::RenderUnit unit)
Sets the unit for the trim distance for the start of the line.
Qgis::RenderUnit trimDistanceEndUnit() const
Returns the unit for the trim distance for the end of the line.
bool alignDashPattern() const
Returns true if dash patterns should be aligned to the start and end of lines, by applying subtle twe...
void setCustomDashPatternUnit(Qgis::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
static QList< Qgis::MarkerShape > availableShapes()
Returns a list of all available shape types.
static bool shapeIsFilled(Qgis::MarkerShape shape)
Returns true if a symbol shape has a fill.
Qgis::MarkerShape shape() const
Returns the shape for the rendered marker symbol.
static QString encodeShape(Qgis::MarkerShape shape)
Encodes a shape to its string representation.
void setShape(Qgis::MarkerShape shape)
Sets the rendered marker shape.
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
void setColor(const QColor &color) override
Sets the "representative" color for the symbol layer.
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
void setStrokeWidthUnit(Qgis::RenderUnit u)
Sets the unit for the width of the marker's stroke.
QgsSimpleMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qt::PenCapStyle penCapStyle() const
Returns the marker's stroke cap style (e.g., flat, round, etc).
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's stroke.
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker's stroke style (e.g., solid, dashed, etc)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
QColor fillColor() const override
Returns the fill color for the symbol layer.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
QColor strokeColor() const override
Returns the marker's stroke color.
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
void setStrokeColor(const QColor &color) override
Sets the marker's stroke color.
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
Qgis::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the marker's stroke cap style (e.g., flat, round, etc).
double strokeWidth() const
Returns the width of the marker's stroke.
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam, double &defaultStrokeWidth, bool blocking=false) const
Tests if an SVG file contains parameters for fill, stroke color, stroke width.
QgsSvgMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
QColor fillColor() const override
Returns the fill color for the symbol layer.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
QString path() const
Returns the marker SVG path.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
void setStrokeWidth(double w)
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the stroke width.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
void setStrokeColor(const QColor &c) override
Sets the stroke color for the symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale) override
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setFillColor(const QColor &color) override
Sets the fill color for the symbol layer.
double strokeWidth() const
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
QMap< QString, QgsProperty > parameters() const
Returns the dynamic SVG parameters.
void setParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the dynamic SVG parameters.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
void setPath(const QString &path)
Set the marker SVG path.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
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 QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Returns an icon preview for a color ramp.
Property
Data definable properties.
@ SkipMultiples
Skip multiples of.
@ GradientType
Gradient fill type.
@ SecondaryColor
Secondary color (eg for gradient fills)
@ File
Filename, eg for svg files.
@ VerticalAnchor
Vertical anchor point.
@ GradientReference2Y
Gradient reference point 2 y.
@ GradientReference1X
Gradient reference point 1 x.
@ OffsetY
Vertical offset.
@ OffsetX
Horizontal offset.
@ GradientReference1Y
Gradient reference point 1 y.
@ DashPatternOffset
Dash pattern offset,.
@ GradientSpread
Gradient spread mode.
@ OffsetAlongLine
Offset along line.
@ CustomDash
Custom dash pattern.
@ ShapeburstMaxDistance
Shapeburst fill from edge distance.
@ HorizontalAnchor
Horizontal anchor point.
@ StrokeStyle
Stroke style (eg solid, dashed)
@ Name
Name, eg shape name for simple markers.
@ DistanceY
Vertical distance between points.
@ DensityArea
Density area.
@ ClipPoints
Whether markers should be clipped to polygon boundaries.
@ LineClipping
Line clipping mode.
@ ShapeburstIgnoreRings
Shapeburst ignore rings.
@ Character
Character, eg for font marker symbol layers.
@ ShapeburstUseWholeShape
Shapeburst use whole shape.
@ DisplacementX
Horizontal displacement.
@ ShowMarker
Show markers.
@ CoordinateMode
Gradient coordinate mode.
@ FillStyle
Fill style (eg solid, dots)
@ GradientReference2X
Gradient reference point 2 x.
@ StrokeColor
Stroke color.
@ TrimStart
Trim distance from start of line.
@ CapStyle
Line cap style.
@ BlurRadius
Shapeburst blur radius.
@ Placement
Line marker placement.
@ MarkerClipping
Marker clipping mode.
@ RandomSeed
Random number seed.
@ LineAngle
Line angle, or angle of hash lines for hash line symbols.
@ JoinStyle
Line join style.
@ RandomOffsetY
Random offset Y.
@ DisplacementY
Vertical displacement.
@ DistanceX
Horizontal distance between points.
@ AverageAngleLength
Length to average symbol angles over.
@ GradientReference1IsCentroid
Gradient reference point 1 is centroid.
@ Interval
Line marker interval.
@ StrokeWidth
Stroke width.
@ GradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ LineDistance
Distance between lines, or length of lines for hash line symbols.
@ RandomOffsetX
Random offset X.
@ TrimEnd
Trim distance from end of line.
virtual QString layerType() const =0
Returns a string that represents this layer type.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Qgis::SymbolType symbolType() const
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol...
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
bool placeOnEveryPart() const
Returns true if the placement applies for every part of multi-part feature geometries.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
void setMapUnitScale(const QgsMapUnitScale &scale) FINAL
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
void setIntervalUnit(Qgis::RenderUnit unit)
Sets the units for the interval between symbols.
void setAverageAngleUnit(Qgis::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
double interval() const
Returns the interval between individual symbols.
void setOffsetAlongLineUnit(Qgis::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
Qgis::MarkerLinePlacements placements() const
Returns the placement of the symbols.
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
Qgis::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
void setInterval(double interval)
Sets the interval between individual symbols.
Qgis::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
void setPlaceOnEveryPart(bool respect)
Sets whether the placement applies for every part of multi-part feature geometries.
void setPlacements(Qgis::MarkerLinePlacements placements)
Sets the placement of the symbols.
Qgis::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols.
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual symbo...
QList< Qgis::RenderUnit > RenderUnitList
List of render units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsSymbolLayer * > QgsSymbolLayerList
Single variable definition for use within a QgsExpressionContextScope.