52 #include <QAbstractButton>
53 #include <QButtonGroup>
54 #include <QColorDialog>
57 #include <QFileDialog>
59 #include <QStandardItemModel>
60 #include <QSvgRenderer>
61 #include <QMessageBox>
64 #include <QInputDialog>
66 #include <QRegularExpression>
71 return *lExpressionContext;
82 expContext << symbolScope;
103 QStringList highlights;
109 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" );
112 if ( expContext.
hasVariable( QStringLiteral(
"zoom_level" ) ) )
114 highlights << QStringLiteral(
"zoom_level" );
116 if ( expContext.
hasVariable( QStringLiteral(
"vector_tile_zoom" ) ) )
118 highlights << QStringLiteral(
"vector_tile_zoom" );
129 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
132 unitWidget->setMapCanvas( mContext.
mapCanvas() );
150 void QgsSymbolLayerWidget::createAuxiliaryField()
171 if ( dlg.exec() == QDialog::Accepted )
172 def = dlg.propertyDefinition();
182 property.setActive(
true );
204 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
205 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
209 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
211 connect( mCheckAlignDash, &QCheckBox::toggled,
this, [ = ]
213 mCheckDashCorners->setEnabled( mCheckAlignDash->isChecked() );
214 if ( !mCheckAlignDash->isChecked() )
215 mCheckDashCorners->setChecked(
false );
223 connect( mCheckDashCorners, &QCheckBox::toggled,
this, [ = ]
245 btnChangeColor->setAllowOpacity(
true );
246 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
247 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
249 mColorDDBtn->registerLinkedWidget( btnChangeColor );
254 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
263 spinOffset->setClearValue( 0.0 );
264 spinPatternOffset->setClearValue( 0.0 );
266 mTrimStartDistanceSpin->setClearValue( 0.0 );
267 mTrimDistanceEndSpin->setClearValue( 0.0 );
273 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
275 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
277 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
278 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
279 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
280 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
281 connect( spinPatternOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::patternOffsetChanged );
283 connect( mTrimStartDistanceSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
300 connect( mTrimDistanceEndSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
326 void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
328 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
330 mAssistantPreviewSymbol->deleteSymbolLayer( i );
332 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
335 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
341 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
348 mPenWidthUnitWidget->blockSignals(
true );
351 mPenWidthUnitWidget->blockSignals(
false );
352 mOffsetUnitWidget->blockSignals(
true );
355 mOffsetUnitWidget->blockSignals(
false );
356 mDashPatternUnitWidget->blockSignals(
true );
359 mDashPatternUnitWidget->blockSignals(
false );
369 spinWidth->blockSignals(
true );
371 spinWidth->blockSignals(
false );
372 btnChangeColor->blockSignals(
true );
374 btnChangeColor->blockSignals(
false );
375 spinOffset->blockSignals(
true );
377 spinOffset->blockSignals(
false );
378 cboPenStyle->blockSignals(
true );
379 cboJoinStyle->blockSignals(
true );
380 cboCapStyle->blockSignals(
true );
384 cboPenStyle->blockSignals(
false );
385 cboJoinStyle->blockSignals(
false );
386 cboCapStyle->blockSignals(
false );
393 mChangePatternButton->setEnabled( useCustomDashPattern );
394 label_3->setEnabled( !useCustomDashPattern );
395 cboPenStyle->setEnabled( !useCustomDashPattern );
396 mCustomCheckBox->blockSignals(
true );
397 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
398 mCustomCheckBox->blockSignals(
false );
401 const QSize size = mChangePatternButton->minimumSizeHint();
403 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
407 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
428 updateAssistantSymbol();
445 mDrawInsideCheckBox->hide();
446 mRingFilterComboBox->hide();
456 void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
463 void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
469 void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
478 void QgsSimpleLineSymbolLayerWidget::offsetChanged()
485 void QgsSimpleLineSymbolLayerWidget::patternOffsetChanged()
492 void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
494 const bool checked = ( state == Qt::Checked );
495 mChangePatternButton->setEnabled( checked );
496 label_3->setEnabled( !checked );
497 cboPenStyle->setEnabled( !checked );
503 void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
510 widget->
setUnit( mDashPatternUnitWidget->unit() );
522 d.setUnit( mDashPatternUnitWidget->unit() );
523 if ( d.exec() == QDialog::Accepted )
531 void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
542 void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
552 void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
563 void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
565 const bool checked = ( state == Qt::Checked );
570 void QgsSimpleLineSymbolLayerWidget::patternOffsetUnitChanged()
587 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
592 const QColor color = qApp->palette().color( QPalette::WindowText );
593 layerCopy->setColor( color );
595 layerCopy->setOffset( 0 );
596 layerCopy->setUseCustomDashPattern(
true );
598 QSize currentIconSize;
601 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
603 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
606 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
612 const std::unique_ptr< QgsLineSymbol > previewSymbol = std::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
614 mChangePatternButton->setIconSize( currentIconSize );
615 mChangePatternButton->setIcon( icon );
619 const int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
620 const int height =
static_cast< int >( width / 1.61803398875 );
624 QBuffer buffer( &data );
625 pm.save( &buffer,
"PNG", 100 );
626 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
631 QgsSymbolLayerWidget::resizeEvent( event );
649 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
650 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
651 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
652 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
660 btnChangeColorFill->setAllowOpacity(
true );
661 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
662 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
663 btnChangeColorFill->setShowNoColor(
true );
664 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
665 btnChangeColorStroke->setAllowOpacity(
true );
666 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
667 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
668 btnChangeColorStroke->setShowNoColor(
true );
669 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
671 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
672 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
674 spinOffsetX->setClearValue( 0.0 );
675 spinOffsetY->setClearValue( 0.0 );
676 spinAngle->setClearValue( 0.0 );
682 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
684 int size = lstNames->iconSize().width();
686 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
688 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
689 lstNames->setIconSize( QSize( size, size ) );
691 const double markerSize = size * 0.8;
697 lyr->
setColor( QColor( 200, 200, 200 ) );
700 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
701 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
706 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
708 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
711 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
712 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged );
713 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
714 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
715 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
716 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
724 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
732 for (
int i = 0; i < lstNames->count(); ++i )
734 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
736 lstNames->setCurrentRow( i );
740 btnChangeColorStroke->blockSignals(
true );
742 btnChangeColorStroke->blockSignals(
false );
743 btnChangeColorFill->blockSignals(
true );
746 btnChangeColorFill->blockSignals(
false );
747 spinSize->blockSignals(
true );
749 spinSize->blockSignals(
false );
750 spinAngle->blockSignals(
true );
752 spinAngle->blockSignals(
false );
753 mStrokeStyleComboBox->blockSignals(
true );
755 mStrokeStyleComboBox->blockSignals(
false );
756 mStrokeWidthSpinBox->blockSignals(
true );
758 mStrokeWidthSpinBox->blockSignals(
false );
759 cboJoinStyle->blockSignals(
true );
761 cboJoinStyle->blockSignals(
false );
762 cboCapStyle->blockSignals(
true );
764 cboCapStyle->blockSignals(
false );
767 spinOffsetX->blockSignals(
true );
769 spinOffsetX->blockSignals(
false );
770 spinOffsetY->blockSignals(
true );
772 spinOffsetY->blockSignals(
false );
774 mSizeUnitWidget->blockSignals(
true );
777 mSizeUnitWidget->blockSignals(
false );
778 mOffsetUnitWidget->blockSignals(
true );
781 mOffsetUnitWidget->blockSignals(
false );
782 mStrokeWidthUnitWidget->blockSignals(
true );
785 mStrokeWidthUnitWidget->blockSignals(
false );
788 mHorizontalAnchorComboBox->blockSignals(
true );
789 mVerticalAnchorComboBox->blockSignals(
true );
792 mHorizontalAnchorComboBox->blockSignals(
false );
793 mVerticalAnchorComboBox->blockSignals(
false );
808 updateAssistantSymbol();
816 void QgsSimpleMarkerSymbolLayerWidget::setShape()
835 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
841 void QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged()
847 void QgsSimpleMarkerSymbolLayerWidget::setSize()
853 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
859 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
861 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
865 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
876 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
885 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
895 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
905 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
915 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
924 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
933 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
935 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
937 mAssistantPreviewSymbol->deleteSymbolLayer( i );
939 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
942 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
961 btnChangeColor->setAllowOpacity(
true );
962 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
963 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
964 btnChangeColor->setShowNoColor(
true );
965 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
966 btnChangeStrokeColor->setAllowOpacity(
true );
967 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
968 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
969 btnChangeStrokeColor->setShowNoColor(
true );
970 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
972 spinOffsetX->setClearValue( 0.0 );
973 spinOffsetY->setClearValue( 0.0 );
976 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
978 connect( spinStrokeWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
979 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
980 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
981 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
982 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
984 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
985 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
990 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
997 btnChangeColor->blockSignals(
true );
999 btnChangeColor->blockSignals(
false );
1000 cboFillStyle->blockSignals(
true );
1002 cboFillStyle->blockSignals(
false );
1003 btnChangeStrokeColor->blockSignals(
true );
1005 btnChangeStrokeColor->blockSignals(
false );
1006 cboStrokeStyle->blockSignals(
true );
1008 cboStrokeStyle->blockSignals(
false );
1009 spinStrokeWidth->blockSignals(
true );
1011 spinStrokeWidth->blockSignals(
false );
1012 cboJoinStyle->blockSignals(
true );
1014 cboJoinStyle->blockSignals(
false );
1015 spinOffsetX->blockSignals(
true );
1017 spinOffsetX->blockSignals(
false );
1018 spinOffsetY->blockSignals(
true );
1020 spinOffsetY->blockSignals(
false );
1022 mStrokeWidthUnitWidget->blockSignals(
true );
1025 mStrokeWidthUnitWidget->blockSignals(
false );
1026 mOffsetUnitWidget->blockSignals(
true );
1029 mOffsetUnitWidget->blockSignals(
false );
1057 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
1063 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
1069 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
1076 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
1078 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1082 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
1092 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1112 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1113 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1119 spinOffsetX->setClearValue( 0.0 );
1120 spinOffsetY->setClearValue( 0.0 );
1121 spinAngle->setClearValue( 0.0 );
1127 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
1129 int size = lstNames->iconSize().width();
1130 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
1131 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
1132 lstNames->setIconSize( QSize( size, size ) );
1134 const double markerSize = size * 0.8;
1140 lyr->
setColor( QColor( 200, 200, 200 ) );
1143 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1144 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
1149 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1151 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1152 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1153 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1154 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1155 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1163 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1171 for (
int i = 0; i < lstNames->count(); ++i )
1173 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1175 lstNames->setCurrentRow( i );
1184 mSizeUnitWidget->blockSignals(
true );
1187 mSizeUnitWidget->blockSignals(
false );
1188 mOffsetUnitWidget->blockSignals(
true );
1191 mOffsetUnitWidget->blockSignals(
false );
1204 updateAssistantSymbol();
1212 void QgsFilledMarkerSymbolLayerWidget::setShape()
1218 void QgsFilledMarkerSymbolLayerWidget::setSize()
1224 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1230 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1232 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1236 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1246 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1256 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1265 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1274 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1276 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1278 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1280 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1283 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1296 connect( mSpinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1300 btnColorRamp->setShowGradientOnly(
true );
1302 btnChangeColor->setAllowOpacity(
true );
1303 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1304 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1305 btnChangeColor->setShowNoColor(
true );
1306 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1307 btnChangeColor2->setAllowOpacity(
true );
1308 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1309 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1310 btnChangeColor2->setShowNoColor(
true );
1311 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1313 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1314 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1316 spinOffsetX->setClearValue( 0.0 );
1317 spinOffsetY->setClearValue( 0.0 );
1318 mSpinAngle->setClearValue( 0.0 );
1326 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1327 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1328 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1329 connect( spinRefPoint1X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1330 connect( spinRefPoint1Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1331 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1332 connect( spinRefPoint2X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1333 connect( spinRefPoint2Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1334 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1339 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1346 btnChangeColor->blockSignals(
true );
1348 btnChangeColor->blockSignals(
false );
1349 btnChangeColor2->blockSignals(
true );
1351 btnChangeColor2->blockSignals(
false );
1355 radioTwoColor->setChecked(
true );
1356 btnColorRamp->setEnabled(
false );
1360 radioColorRamp->setChecked(
true );
1361 btnChangeColor->setEnabled(
false );
1362 btnChangeColor2->setEnabled(
false );
1368 btnColorRamp->blockSignals(
true );
1370 btnColorRamp->blockSignals(
false );
1373 cboGradientType->blockSignals(
true );
1377 cboGradientType->setCurrentIndex( 0 );
1380 cboGradientType->setCurrentIndex( 1 );
1383 cboGradientType->setCurrentIndex( 2 );
1386 cboGradientType->blockSignals(
false );
1388 cboCoordinateMode->blockSignals(
true );
1392 cboCoordinateMode->setCurrentIndex( 1 );
1393 checkRefPoint1Centroid->setEnabled(
false );
1394 checkRefPoint2Centroid->setEnabled(
false );
1398 cboCoordinateMode->setCurrentIndex( 0 );
1401 cboCoordinateMode->blockSignals(
false );
1403 cboGradientSpread->blockSignals(
true );
1407 cboGradientSpread->setCurrentIndex( 0 );
1410 cboGradientSpread->setCurrentIndex( 1 );
1413 cboGradientSpread->setCurrentIndex( 2 );
1416 cboGradientSpread->blockSignals(
false );
1418 spinRefPoint1X->blockSignals(
true );
1420 spinRefPoint1X->blockSignals(
false );
1421 spinRefPoint1Y->blockSignals(
true );
1423 spinRefPoint1Y->blockSignals(
false );
1424 checkRefPoint1Centroid->blockSignals(
true );
1428 spinRefPoint1X->setEnabled(
false );
1429 spinRefPoint1Y->setEnabled(
false );
1431 checkRefPoint1Centroid->blockSignals(
false );
1432 spinRefPoint2X->blockSignals(
true );
1434 spinRefPoint2X->blockSignals(
false );
1435 spinRefPoint2Y->blockSignals(
true );
1437 spinRefPoint2Y->blockSignals(
false );
1438 checkRefPoint2Centroid->blockSignals(
true );
1442 spinRefPoint2X->setEnabled(
false );
1443 spinRefPoint2Y->setEnabled(
false );
1445 checkRefPoint2Centroid->blockSignals(
false );
1447 spinOffsetX->blockSignals(
true );
1449 spinOffsetX->blockSignals(
false );
1450 spinOffsetY->blockSignals(
true );
1452 spinOffsetY->blockSignals(
false );
1453 mSpinAngle->blockSignals(
true );
1455 mSpinAngle->blockSignals(
false );
1457 mOffsetUnitWidget->blockSignals(
true );
1460 mOffsetUnitWidget->blockSignals(
false );
1494 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1496 if ( radioTwoColor->isChecked() )
1509 if ( btnColorRamp->isNull() )
1523 spinRefPoint1X->setValue( 0.5 );
1524 spinRefPoint1Y->setValue( 0 );
1525 spinRefPoint2X->setValue( 0.5 );
1526 spinRefPoint2Y->setValue( 1 );
1531 spinRefPoint1X->setValue( 0 );
1532 spinRefPoint1Y->setValue( 0 );
1533 spinRefPoint2X->setValue( 1 );
1534 spinRefPoint2Y->setValue( 1 );
1538 spinRefPoint1X->setValue( 0.5 );
1539 spinRefPoint1Y->setValue( 0.5 );
1540 spinRefPoint2X->setValue( 1 );
1541 spinRefPoint2Y->setValue( 1 );
1556 checkRefPoint1Centroid->setEnabled(
true );
1557 checkRefPoint2Centroid->setEnabled(
true );
1563 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1564 checkRefPoint1Centroid->setEnabled(
false );
1565 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1566 checkRefPoint2Centroid->setEnabled(
false );
1591 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1593 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1597 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1606 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1612 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1630 connect( mSpinBlurRadius, qOverload< int >( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1631 connect( mSpinMaxDistance, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1633 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1635 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1641 QButtonGroup *group1 =
new QButtonGroup(
this );
1642 group1->addButton( radioColorRamp );
1643 group1->addButton( radioTwoColor );
1644 QButtonGroup *group2 =
new QButtonGroup(
this );
1645 group2->addButton( mRadioUseMaxDistance );
1646 group2->addButton( mRadioUseWholeShape );
1647 btnChangeColor->setAllowOpacity(
true );
1648 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1649 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1650 btnChangeColor->setShowNoColor(
true );
1651 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1652 btnChangeColor2->setAllowOpacity(
true );
1653 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1654 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1655 btnChangeColor2->setShowNoColor(
true );
1656 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1658 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1659 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1661 spinOffsetX->setClearValue( 0.0 );
1662 spinOffsetY->setClearValue( 0.0 );
1663 mSpinMaxDistance->setClearValue( 5.0 );
1665 btnColorRamp->setShowGradientOnly(
true );
1671 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1672 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1673 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1675 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1676 connect( mSpinBlurRadius,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1681 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1688 btnChangeColor->blockSignals(
true );
1690 btnChangeColor->blockSignals(
false );
1691 btnChangeColor2->blockSignals(
true );
1693 btnChangeColor2->blockSignals(
false );
1697 radioTwoColor->setChecked(
true );
1698 btnColorRamp->setEnabled(
false );
1702 radioColorRamp->setChecked(
true );
1703 btnChangeColor->setEnabled(
false );
1704 btnChangeColor2->setEnabled(
false );
1707 mSpinBlurRadius->blockSignals(
true );
1708 mBlurSlider->blockSignals(
true );
1711 mSpinBlurRadius->blockSignals(
false );
1712 mBlurSlider->blockSignals(
false );
1714 mSpinMaxDistance->blockSignals(
true );
1716 mSpinMaxDistance->blockSignals(
false );
1718 mRadioUseWholeShape->blockSignals(
true );
1719 mRadioUseMaxDistance->blockSignals(
true );
1722 mRadioUseWholeShape->setChecked(
true );
1723 mSpinMaxDistance->setEnabled(
false );
1724 mDistanceUnitWidget->setEnabled(
false );
1728 mRadioUseMaxDistance->setChecked(
true );
1729 mSpinMaxDistance->setEnabled(
true );
1730 mDistanceUnitWidget->setEnabled(
true );
1732 mRadioUseWholeShape->blockSignals(
false );
1733 mRadioUseMaxDistance->blockSignals(
false );
1735 mDistanceUnitWidget->blockSignals(
true );
1738 mDistanceUnitWidget->blockSignals(
false );
1740 mIgnoreRingsCheckBox->blockSignals(
true );
1741 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1742 mIgnoreRingsCheckBox->blockSignals(
false );
1747 btnColorRamp->blockSignals(
true );
1749 btnColorRamp->blockSignals(
false );
1752 spinOffsetX->blockSignals(
true );
1754 spinOffsetX->blockSignals(
false );
1755 spinOffsetY->blockSignals(
true );
1757 spinOffsetY->blockSignals(
false );
1758 mOffsetUnitWidget->blockSignals(
true );
1761 mOffsetUnitWidget->blockSignals(
false );
1795 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1802 if ( radioTwoColor->isChecked() )
1813 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1822 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1831 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1841 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1846 mDistanceUnitWidget->setEnabled( !value );
1851 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1861 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1865 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1870 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1881 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1883 const bool checked = ( state == Qt::Checked );
1912 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1921 spinOffset->setClearValue( 0.0 );
1923 mSpinAverageAngleLength->setClearValue( 4.0 );
1927 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1928 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1929 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1930 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1931 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1932 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1933 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1934 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1935 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1936 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1937 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
1949 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1956 spinInterval->blockSignals(
true );
1958 spinInterval->blockSignals(
false );
1959 mSpinOffsetAlongLine->blockSignals(
true );
1961 mSpinOffsetAlongLine->blockSignals(
false );
1962 chkRotateMarker->blockSignals(
true );
1964 chkRotateMarker->blockSignals(
false );
1965 spinOffset->blockSignals(
true );
1967 spinOffset->blockSignals(
false );
1982 mIntervalUnitWidget->blockSignals(
true );
1985 mIntervalUnitWidget->blockSignals(
false );
1986 mOffsetUnitWidget->blockSignals(
true );
1989 mOffsetUnitWidget->blockSignals(
false );
1990 mOffsetAlongLineUnitWidget->blockSignals(
true );
1993 mOffsetAlongLineUnitWidget->blockSignals(
false );
2024 mRingFilterComboBox->hide();
2025 mRingsLabel->hide();
2046 void QgsMarkerLineSymbolLayerWidget::setRotate()
2048 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2049 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2055 void QgsMarkerLineSymbolLayerWidget::setOffset()
2061 void QgsMarkerLineSymbolLayerWidget::setPlacement()
2063 const bool interval = mCheckInterval->isChecked();
2064 spinInterval->setEnabled( interval );
2065 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2066 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2067 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2068 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2070 Qgis::MarkerLinePlacements placements;
2071 if ( mCheckInterval->isChecked() )
2073 if ( mCheckVertex->isChecked() )
2075 if ( mCheckVertexLast->isChecked() )
2077 if ( mCheckVertexFirst->isChecked() )
2079 if ( mCheckCurvePoint->isChecked() )
2081 if ( mCheckSegmentCentralPoint->isChecked() )
2083 if ( mCheckCentralPoint->isChecked() )
2090 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2100 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2110 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2120 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
2130 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2167 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2176 spinOffset->setClearValue( 0.0 );
2178 mHashRotationSpinBox->setClearValue( 0 );
2179 mSpinAverageAngleLength->setClearValue( 4.0 );
2181 connect( spinInterval,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2182 connect( mSpinOffsetAlongLine,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2183 connect( mSpinHashLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2184 connect( mHashRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2185 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2186 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2187 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2189 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2190 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2191 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2192 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2193 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2194 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2195 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2197 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
2209 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2216 spinInterval->blockSignals(
true );
2217 spinInterval->setValue( mLayer->
interval() );
2218 spinInterval->blockSignals(
false );
2219 mSpinOffsetAlongLine->blockSignals(
true );
2221 mSpinOffsetAlongLine->blockSignals(
false );
2224 chkRotateMarker->blockSignals(
true );
2226 chkRotateMarker->blockSignals(
false );
2227 spinOffset->blockSignals(
true );
2228 spinOffset->setValue( mLayer->
offset() );
2229 spinOffset->blockSignals(
false );
2244 mIntervalUnitWidget->blockSignals(
true );
2245 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2247 mIntervalUnitWidget->blockSignals(
false );
2248 mOffsetUnitWidget->blockSignals(
true );
2249 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2251 mOffsetUnitWidget->blockSignals(
false );
2252 mOffsetAlongLineUnitWidget->blockSignals(
true );
2255 mOffsetAlongLineUnitWidget->blockSignals(
false );
2262 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2289 mRingFilterComboBox->hide();
2290 mRingsLabel->hide();
2299 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2305 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2311 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2317 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2323 void QgsHashedLineSymbolLayerWidget::setRotate()
2325 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2326 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2332 void QgsHashedLineSymbolLayerWidget::setOffset()
2334 mLayer->
setOffset( spinOffset->value() );
2338 void QgsHashedLineSymbolLayerWidget::setPlacement()
2340 const bool interval = mCheckInterval->isChecked();
2341 spinInterval->setEnabled( interval );
2342 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2343 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2344 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2345 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2347 Qgis::MarkerLinePlacements placements;
2348 if ( mCheckInterval->isChecked() )
2350 if ( mCheckVertex->isChecked() )
2352 if ( mCheckVertexLast->isChecked() )
2354 if ( mCheckVertexFirst->isChecked() )
2356 if ( mCheckCurvePoint->isChecked() )
2358 if ( mCheckSegmentCentralPoint->isChecked() )
2360 if ( mCheckCentralPoint->isChecked() )
2367 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2377 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2387 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2397 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2407 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2417 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2436 mSvgSelectorWidget->setAllowParameters(
true );
2437 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2438 mSvgSelectorWidget->sourceLineEdit()->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2439 mSvgSelectorWidget->initParametersModel(
this, vl );
2443 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2444 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2448 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2449 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2456 mChangeColorButton->setAllowOpacity(
true );
2457 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2458 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2459 mChangeStrokeColorButton->setAllowOpacity(
true );
2460 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2461 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2463 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2464 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2466 spinOffsetX->setClearValue( 0.0 );
2467 spinOffsetY->setClearValue( 0.0 );
2468 spinAngle->setClearValue( 0.0 );
2470 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2471 connect( spinHeight,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2473 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2474 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2475 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2486 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2487 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2494 #include <QAbstractListModel>
2495 #include <QPixmapCache>
2509 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2510 QColor defaultFill, defaultStroke;
2511 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2512 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2514 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2515 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2516 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2517 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2518 mChangeColorButton->setEnabled( hasFillParam );
2519 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2520 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2521 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2522 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2527 const double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2528 if ( hasDefaultFillColor && !skipDefaultColors )
2532 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2533 mChangeColorButton->setColor( fill );
2535 if ( hasStrokeParam )
2538 const double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2539 if ( hasDefaultStrokeColor && !skipDefaultColors )
2541 stroke = defaultStroke;
2543 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2544 mChangeStrokeColorButton->setColor( stroke );
2547 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( layer->
path() );
2549 mStrokeWidthSpinBox->blockSignals(
true );
2550 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2551 mStrokeWidthSpinBox->blockSignals(
false );
2554 spinHeight->blockSignals(
true );
2555 if ( preservedAspectRatio )
2564 spinHeight->blockSignals(
false );
2565 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2568 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2570 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2572 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2574 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2577 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2588 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2595 mSvgSelectorWidget->setSvgPath(
mLayer->
path() );
2598 spinWidth->blockSignals(
true );
2600 spinWidth->blockSignals(
false );
2601 spinAngle->blockSignals(
true );
2603 spinAngle->blockSignals(
false );
2606 spinOffsetX->blockSignals(
true );
2608 spinOffsetX->blockSignals(
false );
2609 spinOffsetY->blockSignals(
true );
2611 spinOffsetY->blockSignals(
false );
2613 mSizeUnitWidget->blockSignals(
true );
2616 mSizeUnitWidget->blockSignals(
false );
2617 mStrokeWidthUnitWidget->blockSignals(
true );
2620 mStrokeWidthUnitWidget->blockSignals(
false );
2621 mOffsetUnitWidget->blockSignals(
true );
2624 mOffsetUnitWidget->blockSignals(
false );
2627 mHorizontalAnchorComboBox->blockSignals(
true );
2628 mVerticalAnchorComboBox->blockSignals(
true );
2631 mHorizontalAnchorComboBox->blockSignals(
false );
2632 mVerticalAnchorComboBox->blockSignals(
false );
2648 updateAssistantSymbol();
2665 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2674 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2680 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2683 double fixedAspectRatio = 0.0;
2684 spinHeight->blockSignals(
true );
2685 if ( defaultAspectRatio <= 0.0 )
2687 spinHeight->setValue( spinWidth->value() );
2689 else if ( mLockAspectRatio->locked() )
2691 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2695 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2697 spinHeight->blockSignals(
false );
2703 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2706 double fixedAspectRatio = 0.0;
2707 spinWidth->blockSignals(
true );
2708 if ( defaultAspectRatio <= 0.0 )
2710 spinWidth->setValue( spinHeight->value() );
2712 else if ( mLockAspectRatio->locked() )
2714 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2718 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2720 spinWidth->blockSignals(
false );
2726 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2730 if ( defaultAspectRatio <= 0.0 )
2746 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2752 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2754 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2758 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2765 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2776 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2787 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2796 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2806 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2816 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2826 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2835 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2851 mSvgSelectorWidget->setAllowParameters(
true );
2852 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2854 connect( mTextureWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2856 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2858 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2859 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2867 mRotationSpinBox->setClearValue( 0.0 );
2869 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2870 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2871 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2872 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2874 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2875 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2888 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2897 mTextureWidthSpinBox->blockSignals(
true );
2898 mTextureWidthSpinBox->setValue( width );
2899 mTextureWidthSpinBox->blockSignals(
false );
2901 mRotationSpinBox->blockSignals(
true );
2903 mRotationSpinBox->blockSignals(
false );
2904 mTextureWidthUnitWidget->blockSignals(
true );
2907 mTextureWidthUnitWidget->blockSignals(
false );
2908 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2911 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2912 mChangeColorButton->blockSignals(
true );
2914 mChangeColorButton->blockSignals(
false );
2915 mChangeStrokeColorButton->blockSignals(
true );
2917 mChangeStrokeColorButton->blockSignals(
false );
2918 mStrokeWidthSpinBox->blockSignals(
true );
2920 mStrokeWidthSpinBox->blockSignals(
false );
2944 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2953 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2965 void QgsSVGFillSymbolLayerWidget::setFile(
const QString &name )
2968 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2974 void QgsSVGFillSymbolLayerWidget::setSvgParameters(
const QMap<QString, QgsProperty> ¶meters )
2977 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2984 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2996 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2997 QColor defaultFill, defaultStroke;
2998 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2999 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
3001 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
3002 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
3003 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
3004 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
3007 QColor fill = mChangeColorButton->color();
3008 const double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
3009 if ( hasDefaultFillColor )
3013 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
3014 mChangeColorButton->setColor( fill );
3016 mChangeColorButton->setEnabled( hasFillParam );
3017 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
3020 QColor stroke = mChangeStrokeColorButton->color();
3021 const double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
3022 if ( hasDefaultStrokeColor )
3024 stroke = defaultStroke;
3026 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
3027 mChangeStrokeColorButton->setColor( stroke );
3029 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
3030 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
3031 if ( hasDefaultStrokeWidth && resetValues )
3033 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
3035 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
3038 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
3049 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
3060 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3069 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
3079 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
3095 connect( mAngleSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
3096 connect( mDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
3097 connect( mOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
3104 mOffsetSpinBox->setClearValue( 0 );
3105 mAngleSpinBox->setClearValue( 0 );
3109 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3121 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3134 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3148 mDistanceUnitWidget->blockSignals(
true );
3151 mDistanceUnitWidget->blockSignals(
false );
3152 mOffsetUnitWidget->blockSignals(
true );
3155 mOffsetUnitWidget->blockSignals(
false );
3173 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3182 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3191 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3200 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3210 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3226 connect( mHorizontalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3227 connect( mVerticalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3228 connect( mHorizontalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3229 connect( mVerticalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3230 connect( mHorizontalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3231 connect( mVerticalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3232 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3233 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3234 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3235 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3236 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3237 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3255 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3266 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3275 mSeedSpinBox->setShowClearButton(
true );
3276 mSeedSpinBox->setClearValue( 0 );
3277 mRandomXSpinBox->setClearValue( 0 );
3278 mRandomYSpinBox->setClearValue( 0 );
3284 connect( mRandomXSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3292 connect( mRandomYSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3318 connect( mSeedSpinBox, qOverload< int > ( &QSpinBox::valueChanged ),
this, [ = ](
int v )
3327 mAngleSpinBox->setShowClearButton(
true );
3328 mAngleSpinBox->setClearValue( 0 );
3329 connect( mAngleSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3341 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3355 mHorizontalDistanceUnitWidget->blockSignals(
true );
3358 mHorizontalDistanceUnitWidget->blockSignals(
false );
3359 mVerticalDistanceUnitWidget->blockSignals(
true );
3362 mVerticalDistanceUnitWidget->blockSignals(
false );
3363 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3366 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3367 mVerticalDisplacementUnitWidget->blockSignals(
true );
3370 mVerticalDisplacementUnitWidget->blockSignals(
false );
3371 mHorizontalOffsetUnitWidget->blockSignals(
true );
3374 mHorizontalOffsetUnitWidget->blockSignals(
false );
3375 mVerticalOffsetUnitWidget->blockSignals(
true );
3378 mVerticalOffsetUnitWidget->blockSignals(
false );
3410 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3419 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3428 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3437 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3446 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3455 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3464 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3474 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3484 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3494 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3504 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3514 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3535 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3536 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3537 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3547 scrollArea->setVerticalOnly(
true );
3549 btnColor->setAllowOpacity(
true );
3550 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3551 btnColor->setContext( QStringLiteral(
"symbology" ) );
3552 btnStrokeColor->setAllowOpacity(
true );
3553 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3554 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3556 mColorDDBtn->registerLinkedWidget( btnColor );
3557 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3559 spinOffsetX->setClearValue( 0.0 );
3560 spinOffsetY->setClearValue( 0.0 );
3561 spinAngle->setClearValue( 0.0 );
3567 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3570 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3572 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3575 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3577 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3578 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3589 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3598 mFontStyleComboBox->blockSignals(
true );
3599 populateFontStyleComboBox();
3600 mFontStyleComboBox->blockSignals(
false );
3618 mCharPreview->setFont( mRefFont );
3624 mSizeUnitWidget->blockSignals(
true );
3627 mSizeUnitWidget->blockSignals(
false );
3629 mStrokeWidthUnitWidget->blockSignals(
true );
3632 mStrokeWidthUnitWidget->blockSignals(
false );
3634 mOffsetUnitWidget->blockSignals(
true );
3637 mOffsetUnitWidget->blockSignals(
false );
3658 updateAssistantSymbol();
3671 mRefFont.setFamily( font.family() );
3673 mCharPreview->setFont( mRefFont );
3674 populateFontStyleComboBox();
3679 void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3686 mCharPreview->setFont( mRefFont );
3718 mCharPreview->setText( text );
3720 if ( text.isEmpty() )
3724 QString character = text;
3725 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3728 const unsigned int value = text.toUInt( &ok, 0 );
3731 character = QChar( value );
3732 mCharPreview->setText( character );
3753 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3755 mCharLineEdit->insert( chr );
3761 mCharPreview->setText( chr );
3765 void QgsFontMarkerSymbolLayerWidget::setOffset()
3767 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3771 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3777 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3787 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3797 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3807 void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3809 mFontStyleComboBox->clear();
3810 const QStringList styles = mFontDB.styles( mRefFont.family() );
3811 const auto constStyles = styles;
3812 for (
const QString &style : constStyles )
3814 mFontStyleComboBox->addItem( style );
3817 QString targetStyle = mFontDB.styleString( mRefFont );
3818 if ( !styles.contains( targetStyle ) )
3820 const QFont f = QFont( mRefFont.family() );
3821 targetStyle = QFontInfo( f ).styleName();
3822 mRefFont.setStyleName( targetStyle );
3825 const int stylIndx = mFontStyleComboBox->findText( targetStyle );
3826 if ( stylIndx > -1 )
3831 mFontStyleComboBox->setCurrentIndex( curIndx );
3834 void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3837 setFontStyle( mFontStyleComboBox->currentText() );
3840 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3849 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3858 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3867 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3869 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3871 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3873 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3876 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3888 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3889 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3890 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3891 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3896 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3914 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3920 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3926 void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3932 void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3947 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3951 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3953 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3954 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3962 mSpinOffsetX->setClearValue( 0.0 );
3963 mSpinOffsetY->setClearValue( 0.0 );
3964 mRotationSpinBox->setClearValue( 0.0 );
3966 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3967 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3970 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3971 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3981 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3992 mHeightSpinBox->blockSignals(
true );
3993 if ( preservedAspectRatio )
4002 mHeightSpinBox->blockSignals(
false );
4003 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4011 mSizeUnitWidget->blockSignals(
true );
4014 mSizeUnitWidget->blockSignals(
false );
4015 mOffsetUnitWidget->blockSignals(
true );
4018 mOffsetUnitWidget->blockSignals(
false );
4033 updatePreviewImage();
4047 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4050 updatePreviewImage();
4054 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
4056 bool fitsInCache =
false;
4058 if ( image.isNull() )
4060 mLabelImagePreview->setPixmap( QPixmap() );
4064 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4065 previewImage.fill( Qt::transparent );
4066 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4068 p.begin( &previewImage );
4070 uchar pixDataRGB[] = { 150, 150, 150, 150,
4075 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4076 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4077 QBrush checkerBrush;
4078 checkerBrush.setTexture( pix );
4079 p.fillRect( imageRect, checkerBrush );
4086 p.drawImage( imageRect.left(), imageRect.top(), image );
4088 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4091 void QgsRasterMarkerSymbolLayerWidget::setWidth()
4094 double fixedAspectRatio = 0.0;
4095 mHeightSpinBox->blockSignals(
true );
4096 if ( defaultAspectRatio <= 0.0 )
4098 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4100 else if ( mLockAspectRatio->locked() )
4102 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4106 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4108 mHeightSpinBox->blockSignals(
false );
4114 void QgsRasterMarkerSymbolLayerWidget::setHeight()
4117 double fixedAspectRatio = 0.0;
4118 mWidthSpinBox->blockSignals(
true );
4119 if ( defaultAspectRatio <= 0.0 )
4121 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4123 else if ( mLockAspectRatio->locked() )
4125 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4129 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4131 mWidthSpinBox->blockSignals(
false );
4137 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4140 if ( defaultAspectRatio <= 0.0 )
4155 void QgsRasterMarkerSymbolLayerWidget::setAngle()
4161 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
4165 updatePreviewImage();
4168 void QgsRasterMarkerSymbolLayerWidget::setOffset()
4170 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4174 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4184 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4194 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4203 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4220 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4224 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
4226 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
4233 mSpinOffsetX->setClearValue( 0.0 );
4234 mSpinOffsetY->setClearValue( 0.0 );
4235 mRotationSpinBox->setClearValue( 0.0 );
4237 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4238 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4239 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4251 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4264 cboCoordinateMode->blockSignals(
true );
4268 cboCoordinateMode->setCurrentIndex( 1 );
4272 cboCoordinateMode->setCurrentIndex( 0 );
4275 cboCoordinateMode->blockSignals(
false );
4281 mOffsetUnitWidget->blockSignals(
true );
4284 mOffsetUnitWidget->blockSignals(
false );
4287 mWidthUnitWidget->blockSignals(
true );
4290 mWidthUnitWidget->blockSignals(
false );
4292 updatePreviewImage();
4306 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4309 updatePreviewImage();
4313 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4330 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4339 updatePreviewImage();
4342 void QgsRasterFillSymbolLayerWidget::offsetChanged()
4344 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4348 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4359 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4368 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4379 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4389 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4391 bool fitsInCache =
false;
4393 if ( image.isNull() )
4395 mLabelImagePreview->setPixmap( QPixmap() );
4399 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4400 previewImage.fill( Qt::transparent );
4401 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4403 p.begin( &previewImage );
4405 uchar pixDataRGB[] = { 150, 150, 150, 150,
4410 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4411 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4412 QBrush checkerBrush;
4413 checkerBrush.setTexture( pix );
4414 p.fillRect( imageRect, checkerBrush );
4421 p.drawImage( imageRect.left(), imageRect.top(), image );
4423 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4437 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4454 connect( spinWidth, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ]
4474 spinOffset->setClearValue( 0.0 );
4475 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
4484 connect( cboCapStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4492 connect( cboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4507 updatePreviewImage();
4520 if ( layer->
layerType() != QLatin1String(
"RasterLine" ) )
4544 updatePreviewImage();
4559 void QgsRasterLineSymbolLayerWidget::imageSourceChanged(
const QString &text )
4562 updatePreviewImage();
4566 void QgsRasterLineSymbolLayerWidget::updatePreviewImage()
4568 bool fitsInCache =
false;
4570 if ( image.isNull() )
4572 mLabelImagePreview->setPixmap( QPixmap() );
4576 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4577 previewImage.fill( Qt::transparent );
4578 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4580 p.begin( &previewImage );
4582 uchar pixDataRGB[] = { 150, 150, 150, 150,
4587 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4588 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4589 QBrush checkerBrush;
4590 checkerBrush.setTexture( pix );
4591 p.fillRect( imageRect, checkerBrush );
4598 p.drawImage( imageRect.left(), imageRect.top(), image );
4600 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4614 modificationExpressionSelector->setMultiLine(
true );
4615 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4616 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4627 mUnitWidget->setShowMapScaleButton(
false );
4630 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4633 if ( !mBlockSignals )
4635 mLayer->
setUnits( mUnitWidget->unit() );
4646 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData(
static_cast< int >( mLayer->
symbolType() ) ) );
4647 mUnitWidget->setUnit( mLayer->
units() );
4656 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4663 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4666 std::unique_ptr< QgsSymbol > subSymbol( mLayer->
subSymbol()->
clone() );
4681 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4684 layers << subSymbol->symbolLayer( i )->clone();
4687 if ( !layers.empty() )
4697 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4698 layers << subSymbol->symbolLayer( i )->clone();
4717 mCountMethodComboBox->addItem( tr(
"Absolute Count" ),
static_cast< int >( Qgis::PointCountMethod::Absolute ) );
4718 mCountMethodComboBox->addItem( tr(
"Density-based Count" ),
static_cast< int >( Qgis::PointCountMethod::DensityBased ) );
4720 mPointCountSpinBox->setShowClearButton(
true );
4721 mPointCountSpinBox->setClearValue( 100 );
4722 mSeedSpinBox->setShowClearButton(
true );
4723 mSeedSpinBox->setClearValue( 0 );
4725 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
4726 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
4727 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
4728 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
4729 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
4746 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
4756 bool showDensityBasedCountWidgets =
false;
4759 case Qgis::PointCountMethod::DensityBased:
4760 showDensityBasedCountWidgets =
true;
4762 case Qgis::PointCountMethod::Absolute:
4765 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4766 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4767 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4768 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4770 whileBlocking( mCountMethodComboBox )->setCurrentIndex( mCountMethodComboBox->findData(
static_cast< int >( mLayer->
countMethod() ) ) );
4772 mDensityAreaUnitWidget->blockSignals(
true );
4775 mDensityAreaUnitWidget->blockSignals(
false );
4788 void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
4791 bool showDensityBasedCountWidgets =
false;
4794 case Qgis::PointCountMethod::DensityBased:
4795 showDensityBasedCountWidgets =
true;
4797 case Qgis::PointCountMethod::Absolute:
4800 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4801 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4802 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4803 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4812 void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
4821 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
4830 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
4840 void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
4859 btnColorRamp->setShowGradientOnly(
true );
4861 btnChangeColor->setAllowOpacity(
true );
4862 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
4863 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
4864 btnChangeColor->setShowNoColor(
true );
4865 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
4866 btnChangeColor2->setAllowOpacity(
true );
4867 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
4868 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
4869 btnChangeColor2->setShowNoColor(
true );
4870 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
4872 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
4873 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
4893 if ( btnColorRamp->isNull() )
4903 connect( radioTwoColor, &QAbstractButton::toggled,
this, [ = ]
4907 if ( radioTwoColor->isChecked() )
4909 mLayer->setGradientColorType( Qgis::GradientColorSource::SimpleTwoColor );
4910 btnChangeColor->setEnabled( true );
4911 btnChangeColor2->setEnabled( true );
4912 btnColorRamp->setEnabled( false );
4916 mLayer->setGradientColorType( Qgis::GradientColorSource::ColorRamp );
4917 btnColorRamp->setEnabled( true );
4918 btnChangeColor->setEnabled( false );
4919 btnChangeColor2->setEnabled( false );
4940 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ]
4959 spinOffset->setClearValue( 0.0 );
4960 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
4969 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
4977 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
4994 if ( layer->
layerType() != QLatin1String(
"Lineburst" ) )
5005 btnChangeColor->blockSignals(
true );
5007 btnChangeColor->blockSignals(
false );
5008 btnChangeColor2->blockSignals(
true );
5010 btnChangeColor2->blockSignals(
false );
5014 radioTwoColor->setChecked(
true );
5015 btnColorRamp->setEnabled(
false );
5019 radioColorRamp->setChecked(
true );
5020 btnChangeColor->setEnabled(
false );
5021 btnChangeColor2->setEnabled(
false );
5027 btnColorRamp->blockSignals(
true );
5029 btnColorRamp->blockSignals(
false );
@ 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) (since QGIS 3....
@ 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.
MarkerShape
Marker shapes.
@ 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.
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.
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.
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.
void setAngle(double angle)
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
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 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.
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.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
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.
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 bool updateFontViaStyle(QFont &f, const QString &fontstyle, bool fallback=false)
Updates font with named style and retain all font properties.
QString geometryExpression() const
Gets the expression to generate this geometry.
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.
void setUnits(QgsUnitTypes::RenderUnit units)
Sets the units for the geometry expression.
QgsUnitTypes::RenderUnit units() const
Returns the unit for the geometry expression.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
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::SymbolCoordinateReference coordinateMode() const
Returns the coordinate mode for gradient, which controls how the gradient stops are positioned.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
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 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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
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...
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.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
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.
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
double hashLength() const
Returns 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.
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false, double targetDpi=96, 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.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for 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 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 setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern's offset.
double distance() const
Returns the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for 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...
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
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...
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line's offset.
void setOffset(double offset)
Sets the line's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns 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 & widthMapUnitScale() const
A line symbol type, for rendering LineString and MultiLineString geometries.
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...
QColor color() const override
Returns the "representative" color of the symbol layer.
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient line.
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 setAngle(double angle)
Sets the rotation angle for the marker.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
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.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
double size() const
Returns the symbol size.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
VerticalAnchorPoint
Symbol vertical anchor points.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
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.
void setDisplacementX(double d)
Sets the horizontal displacement for odd numbered rows in the pattern.
const QgsMapUnitScale & displacementYMapUnitScale() const
Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setOffsetYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
void setRandomDeviationXUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit 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.
QgsUnitTypes::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
double distanceX() const
Returns the horizontal distance between rendered markers in the fill.
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
void setRandomDeviationYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical random deviation of points in the pattern.
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows 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.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
void setRandomDeviationXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal random deviation of points in the pattern.
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
QgsUnitTypes::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of 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.
QgsUnitTypes::RenderUnit randomDeviationXUnit() const
Returns the units for the horizontal random deviation of points in the pattern.
const QgsMapUnitScale & distanceYMapUnitScale() const
Returns the map unit scale for the vertical distance between points 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 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.
QgsUnitTypes::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
void setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the horizontal distance between points in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal distance between points in the pattern.
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal 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 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.
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical 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.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
const QgsMapUnitScale & randomDeviationYMapUnitScale() const
Returns the unit scale for the vertical random deviation of points in the pattern.
void setDisplacementXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal displacement between rows 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.
void setRandomDeviationYUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the vertical random deviation of points in the pattern.
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal 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 angle() const
Returns the rotation angle of the pattern, in degrees clockwise.
void setOffsetXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
Returns the map unit scale for the horizontal distance between points in the pattern.
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the vertical distance between points in the pattern.
void setAngle(double angle)
Sets the rotation angle of the pattern, in degrees clockwise.
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.
const QgsMapUnitScale & displacementXMapUnitScale() const
Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
QgsProperty property(int key) const override
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.
QgsUnitTypes::RenderUnit densityAreaUnit() const
Returns the units for the density area.
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 setDensityAreaUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the density area.
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...
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
void setPointCount(int count)
Sets the count of random points to render in the fill.
Qgis::PointCountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
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.
double width() const
Returns the width used for scaling the image used in the fill.
void setWidthUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the image's width.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image's width.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
double opacity() const
Returns the opacity for the raster image used in the fill.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
QPointF offset() const
Returns the offset for the fill.
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.
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
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 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.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit 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.
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
const QgsMapUnitScale & distanceMapUnitScale() const
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 setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
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.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
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 & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns 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)
void setStrokeStyle(Qt::PenStyle strokeStyle)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QPointF offset()
Returns the offset by which polygons will be translated during rendering.
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.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill's stroke.
Qt::BrushStyle brushStyle() const
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
QgsUnitTypes::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
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...
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap 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.
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
void setDashPatternOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the dash pattern offset.
QgsUnitTypes::RenderUnit trimDistanceStartUnit() const
Returns the unit 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.
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units 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.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
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...
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
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 ...
double trimDistanceEnd() const
Returns the trim distance for the end of the line, which dictates a length from the end of the line a...
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.
QgsUnitTypes::RenderUnit trimDistanceEndUnit() const
Returns the unit for the trim distance for the end of the line.
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
const QgsMapUnitScale & dashPatternOffsetMapUnitScale() const
Returns the map unit scale for the dash pattern offset value.
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 setTrimDistanceStartUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the trim distance for the start of the line.
void setTrimDistanceStartMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the start of the line.
void setTrimDistanceEndUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the trim distance for the end of the line.
Qt::PenCapStyle penCapStyle() const
Returns 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.
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
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 ...
bool alignDashPattern() const
Returns true if dash patterns should be aligned to the start and end of lines, by applying subtle twe...
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 setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker's 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).
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.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
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)
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.
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)
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
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
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 QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr)
Returns a pixmap preview for a color ramp.
static QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr)
Returns an icon preview for a color ramp.
static QIcon symbolLayerPreviewIcon(const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid)
Draws a symbol layer preview to an icon.
Property
Data definable properties.
@ PropertyGradientReference1X
Gradient reference point 1 x.
@ PropertyShapeburstIgnoreRings
Shapeburst ignore rings.
@ PropertyGradientReference2X
Gradient reference point 2 x.
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
@ PropertyPlacement
Line marker placement.
@ PropertyHorizontalAnchor
Horizontal anchor point.
@ PropertyDistanceX
Horizontal distance between points.
@ PropertyFile
Filename, eg for svg files.
@ PropertyGradientType
Gradient fill type.
@ PropertyCapStyle
Line cap style.
@ PropertyAngle
Symbol angle.
@ PropertyLineClipping
Line clipping mode (since QGIS 3.24)
@ PropertyDistanceY
Vertical distance between points.
@ PropertyDisplacementX
Horizontal displacement.
@ PropertyVerticalAnchor
Vertical anchor point.
@ PropertyGradientSpread
Gradient spread mode.
@ PropertyOffsetY
Vertical offset.
@ PropertyGradientReference1Y
Gradient reference point 1 y.
@ PropertyLineDistance
Distance between lines, or length of lines for hash line symbols.
@ PropertyOffsetAlongLine
Offset along line.
@ PropertyBlurRadius
Shapeburst blur radius.
@ PropertyGradientReference2Y
Gradient reference point 2 y.
@ PropertyMarkerClipping
Marker clipping mode (since QGIS 3.24)
@ PropertyDensityArea
Density area.
@ PropertyGradientReference1IsCentroid
Gradient reference point 1 is centroid.
@ PropertyCustomDash
Custom dash pattern.
@ PropertyShapeburstUseWholeShape
Shapeburst use whole shape.
@ PropertySize
Symbol size.
@ PropertyOffsetX
Horizontal offset.
@ PropertyJoinStyle
Line join style.
@ PropertyTrimEnd
Trim distance from end of line (since QGIS 3.20)
@ PropertyOpacity
Opacity.
@ PropertySecondaryColor
Secondary color (eg for gradient fills)
@ PropertyCharacter
Character, eg for font marker symbol layers.
@ PropertyCoordinateMode
Gradient coordinate mode.
@ PropertyRandomOffsetY
Random offset Y (since QGIS 3.24)
@ PropertyLineAngle
Line angle, or angle of hash lines for hash line symbols.
@ PropertyShapeburstMaxDistance
Shapeburst fill from edge distance.
@ PropertyTrimStart
Trim distance from start of line (since QGIS 3.20)
@ PropertyOffset
Symbol offset.
@ PropertyStrokeWidth
Stroke width.
@ PropertyDashPatternOffset
Dash pattern offset,.
@ PropertyFillColor
Fill color.
@ PropertyFontStyle
Font style.
@ PropertyHeight
Symbol height.
@ PropertyClipPoints
Whether markers should be clipped to polygon boundaries.
@ PropertyFontFamily
Font family.
@ PropertyPointCount
Point count.
@ PropertyRandomSeed
Random number seed.
@ PropertyName
Name, eg shape name for simple markers.
@ PropertyAverageAngleLength
Length to average symbol angles over.
@ PropertyInterval
Line marker interval.
@ PropertyRandomOffsetX
Random offset X (since QGIS 3.24)
@ PropertyFillStyle
Fill style (eg solid, dots)
@ PropertyDisplacementY
Vertical displacement.
@ PropertyStrokeColor
Stroke color.
@ PropertyGradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ PropertyWidth
Symbol width.
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...
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
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 setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
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.
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setInterval(double interval)
Sets the interval between individual symbols.
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols.
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
void setPlaceOnEveryPart(bool respect)
Sets whether the placement applies for every part of multi-part feature geometries.
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
void setPlacements(Qgis::MarkerLinePlacements placements)
Sets the placement of the symbols.
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between 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< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
@ RenderMetersInMapUnits
Meters value as Map units.
@ RenderPercentage
Percentage of another measurement (e.g., canvas size, feature size)
@ RenderPoints
Points (e.g., for font sizes)
@ RenderMillimeters
Millimeters.
@ RenderMapUnits
Map units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
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.