46#include <QAbstractButton>
47#include <QButtonGroup>
48#include <QColorDialog>
53#include <QStandardItemModel>
54#include <QSvgRenderer>
58#include <QInputDialog>
60#include <QRegularExpression>
66 return *lExpressionContext;
77 expContext << symbolScope;
99 QStringList highlights;
105 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" ) << QStringLiteral(
"symbol_frame" );
108 if ( expContext.
hasVariable( QStringLiteral(
"zoom_level" ) ) )
110 highlights << QStringLiteral(
"zoom_level" );
112 if ( expContext.
hasVariable( QStringLiteral(
"vector_tile_zoom" ) ) )
114 highlights << QStringLiteral(
"vector_tile_zoom" );
125 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
128 unitWidget->setMapCanvas( mContext.
mapCanvas() );
146void QgsSymbolLayerWidget::createAuxiliaryField()
167 if ( dlg.exec() == QDialog::Accepted )
168 def = dlg.propertyDefinition();
178 property.setActive(
true );
200 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
201 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
205 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
207 connect( mCheckAlignDash, &QCheckBox::toggled,
this, [ = ]
209 mCheckDashCorners->setEnabled( mCheckAlignDash->isChecked() );
210 if ( !mCheckAlignDash->isChecked() )
211 mCheckDashCorners->setChecked(
false );
219 connect( mCheckDashCorners, &QCheckBox::toggled,
this, [ = ]
241 btnChangeColor->setAllowOpacity(
true );
242 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
243 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
245 mColorDDBtn->registerLinkedWidget( btnChangeColor );
250 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
259 spinOffset->setClearValue( 0.0 );
260 spinPatternOffset->setClearValue( 0.0 );
262 mTrimStartDistanceSpin->setClearValue( 0.0 );
263 mTrimDistanceEndSpin->setClearValue( 0.0 );
269 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
271 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
273 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
274 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
275 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
276 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
277 connect( spinPatternOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::patternOffsetChanged );
279 connect( mTrimStartDistanceSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
296 connect( mTrimDistanceEndSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
322void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
324 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
326 mAssistantPreviewSymbol->deleteSymbolLayer( i );
328 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
331 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
337 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
344 mPenWidthUnitWidget->blockSignals(
true );
347 mPenWidthUnitWidget->blockSignals(
false );
348 mOffsetUnitWidget->blockSignals(
true );
351 mOffsetUnitWidget->blockSignals(
false );
352 mDashPatternUnitWidget->blockSignals(
true );
355 mDashPatternUnitWidget->blockSignals(
false );
365 spinWidth->blockSignals(
true );
367 spinWidth->blockSignals(
false );
368 btnChangeColor->blockSignals(
true );
370 btnChangeColor->blockSignals(
false );
371 spinOffset->blockSignals(
true );
373 spinOffset->blockSignals(
false );
374 cboPenStyle->blockSignals(
true );
375 cboJoinStyle->blockSignals(
true );
376 cboCapStyle->blockSignals(
true );
380 cboPenStyle->blockSignals(
false );
381 cboJoinStyle->blockSignals(
false );
382 cboCapStyle->blockSignals(
false );
389 mChangePatternButton->setEnabled( useCustomDashPattern );
390 label_3->setEnabled( !useCustomDashPattern );
391 cboPenStyle->setEnabled( !useCustomDashPattern );
392 mCustomCheckBox->blockSignals(
true );
393 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
394 mCustomCheckBox->blockSignals(
false );
397 const QSize size = mChangePatternButton->minimumSizeHint();
399 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
403 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
424 updateAssistantSymbol();
441 mDrawInsideCheckBox->hide();
442 mRingFilterComboBox->hide();
452void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
459void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
465void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
474void QgsSimpleLineSymbolLayerWidget::offsetChanged()
481void QgsSimpleLineSymbolLayerWidget::patternOffsetChanged()
488void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
490 const bool checked = ( state == Qt::Checked );
491 mChangePatternButton->setEnabled( checked );
492 label_3->setEnabled( !checked );
493 cboPenStyle->setEnabled( !checked );
499void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
506 widget->
setUnit( mDashPatternUnitWidget->unit() );
518 d.setUnit( mDashPatternUnitWidget->unit() );
519 if ( d.exec() == QDialog::Accepted )
527void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
538void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
548void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
559void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
561 const bool checked = ( state == Qt::Checked );
566void QgsSimpleLineSymbolLayerWidget::patternOffsetUnitChanged()
583 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
588 const QColor color = qApp->palette().color( QPalette::WindowText );
589 layerCopy->setColor( color );
591 layerCopy->setOffset( 0 );
592 layerCopy->setUseCustomDashPattern(
true );
594 QSize currentIconSize;
597 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
599 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
602 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
608 const std::unique_ptr< QgsLineSymbol > previewSymbol = std::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
610 mChangePatternButton->setIconSize( currentIconSize );
611 mChangePatternButton->setIcon( icon );
615 const int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
616 const int height =
static_cast< int >( width / 1.61803398875 );
620 QBuffer buffer( &data );
621 pm.save( &buffer,
"PNG", 100 );
622 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3' width=\"%4\">" ).arg( QString( data.toBase64() ) ).arg( width ) );
627 QgsSymbolLayerWidget::resizeEvent( event );
645 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
646 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
647 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
648 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
656 btnChangeColorFill->setAllowOpacity(
true );
657 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
658 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
659 btnChangeColorFill->setShowNoColor(
true );
660 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
661 btnChangeColorStroke->setAllowOpacity(
true );
662 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
663 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
664 btnChangeColorStroke->setShowNoColor(
true );
665 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
667 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
668 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
670 spinOffsetX->setClearValue( 0.0 );
671 spinOffsetY->setClearValue( 0.0 );
672 spinAngle->setClearValue( 0.0 );
678 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
680 int size = lstNames->iconSize().width();
682 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
684 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
685 lstNames->setIconSize( QSize( size, size ) );
687 const double markerSize = size * 0.8;
693 lyr->
setColor( QColor( 200, 200, 200 ) );
696 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
697 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
702 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
704 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
707 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
708 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged );
709 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
710 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
711 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
712 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
720 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
728 for (
int i = 0; i < lstNames->count(); ++i )
730 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
732 lstNames->setCurrentRow( i );
736 btnChangeColorStroke->blockSignals(
true );
738 btnChangeColorStroke->blockSignals(
false );
739 btnChangeColorFill->blockSignals(
true );
742 btnChangeColorFill->blockSignals(
false );
743 spinSize->blockSignals(
true );
745 spinSize->blockSignals(
false );
746 spinAngle->blockSignals(
true );
748 spinAngle->blockSignals(
false );
749 mStrokeStyleComboBox->blockSignals(
true );
751 mStrokeStyleComboBox->blockSignals(
false );
752 mStrokeWidthSpinBox->blockSignals(
true );
754 mStrokeWidthSpinBox->blockSignals(
false );
755 cboJoinStyle->blockSignals(
true );
757 cboJoinStyle->blockSignals(
false );
758 cboCapStyle->blockSignals(
true );
760 cboCapStyle->blockSignals(
false );
763 spinOffsetX->blockSignals(
true );
765 spinOffsetX->blockSignals(
false );
766 spinOffsetY->blockSignals(
true );
768 spinOffsetY->blockSignals(
false );
770 mSizeUnitWidget->blockSignals(
true );
773 mSizeUnitWidget->blockSignals(
false );
774 mOffsetUnitWidget->blockSignals(
true );
777 mOffsetUnitWidget->blockSignals(
false );
778 mStrokeWidthUnitWidget->blockSignals(
true );
781 mStrokeWidthUnitWidget->blockSignals(
false );
784 mHorizontalAnchorComboBox->blockSignals(
true );
785 mVerticalAnchorComboBox->blockSignals(
true );
788 mHorizontalAnchorComboBox->blockSignals(
false );
789 mVerticalAnchorComboBox->blockSignals(
false );
804 updateAssistantSymbol();
812void QgsSimpleMarkerSymbolLayerWidget::setShape()
831void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
837void QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged()
843void QgsSimpleMarkerSymbolLayerWidget::setSize()
849void QgsSimpleMarkerSymbolLayerWidget::setAngle()
855void QgsSimpleMarkerSymbolLayerWidget::setOffset()
857 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
861void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
872void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
881void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
891void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
901void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
911void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
920void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
929void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
931 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
933 mAssistantPreviewSymbol->deleteSymbolLayer( i );
935 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
938 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
957 btnChangeColor->setAllowOpacity(
true );
958 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
959 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
960 btnChangeColor->setShowNoColor(
true );
961 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
962 btnChangeStrokeColor->setAllowOpacity(
true );
963 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
964 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
965 btnChangeStrokeColor->setShowNoColor(
true );
966 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
968 spinOffsetX->setClearValue( 0.0 );
969 spinOffsetY->setClearValue( 0.0 );
972 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
974 connect( spinStrokeWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
975 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
976 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
977 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
978 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
980 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
981 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
986 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
993 btnChangeColor->blockSignals(
true );
995 btnChangeColor->blockSignals(
false );
996 cboFillStyle->blockSignals(
true );
998 cboFillStyle->blockSignals(
false );
999 btnChangeStrokeColor->blockSignals(
true );
1001 btnChangeStrokeColor->blockSignals(
false );
1002 cboStrokeStyle->blockSignals(
true );
1004 cboStrokeStyle->blockSignals(
false );
1005 spinStrokeWidth->blockSignals(
true );
1007 spinStrokeWidth->blockSignals(
false );
1008 cboJoinStyle->blockSignals(
true );
1010 cboJoinStyle->blockSignals(
false );
1011 spinOffsetX->blockSignals(
true );
1013 spinOffsetX->blockSignals(
false );
1014 spinOffsetY->blockSignals(
true );
1016 spinOffsetY->blockSignals(
false );
1018 mStrokeWidthUnitWidget->blockSignals(
true );
1021 mStrokeWidthUnitWidget->blockSignals(
false );
1022 mOffsetUnitWidget->blockSignals(
true );
1025 mOffsetUnitWidget->blockSignals(
false );
1053void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
1059void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
1065void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
1072void QgsSimpleFillSymbolLayerWidget::offsetChanged()
1074 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1078void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
1088void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1108 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1109 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1115 spinOffsetX->setClearValue( 0.0 );
1116 spinOffsetY->setClearValue( 0.0 );
1117 spinAngle->setClearValue( 0.0 );
1123 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
1125 int size = lstNames->iconSize().width();
1126 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
1127 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
1128 lstNames->setIconSize( QSize( size, size ) );
1130 const double markerSize = size * 0.8;
1136 lyr->
setColor( QColor( 200, 200, 200 ) );
1139 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1140 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
1145 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1147 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1148 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1149 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1150 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1151 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1159 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1167 for (
int i = 0; i < lstNames->count(); ++i )
1169 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1171 lstNames->setCurrentRow( i );
1180 mSizeUnitWidget->blockSignals(
true );
1183 mSizeUnitWidget->blockSignals(
false );
1184 mOffsetUnitWidget->blockSignals(
true );
1187 mOffsetUnitWidget->blockSignals(
false );
1200 updateAssistantSymbol();
1208void QgsFilledMarkerSymbolLayerWidget::setShape()
1214void QgsFilledMarkerSymbolLayerWidget::setSize()
1220void QgsFilledMarkerSymbolLayerWidget::setAngle()
1226void QgsFilledMarkerSymbolLayerWidget::setOffset()
1228 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1232void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1242void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1252void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1261void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1270void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1272 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1274 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1276 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1279 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1292 connect( mSpinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1296 btnColorRamp->setShowGradientOnly(
true );
1298 btnChangeColor->setAllowOpacity(
true );
1299 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1300 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1301 btnChangeColor->setShowNoColor(
true );
1302 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1303 btnChangeColor2->setAllowOpacity(
true );
1304 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1305 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1306 btnChangeColor2->setShowNoColor(
true );
1307 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1309 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1310 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1312 spinOffsetX->setClearValue( 0.0 );
1313 spinOffsetY->setClearValue( 0.0 );
1314 mSpinAngle->setClearValue( 0.0 );
1322 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1323 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1324 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1325 connect( spinRefPoint1X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1326 connect( spinRefPoint1Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1327 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1328 connect( spinRefPoint2X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1329 connect( spinRefPoint2Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1330 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1335 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1342 btnChangeColor->blockSignals(
true );
1344 btnChangeColor->blockSignals(
false );
1345 btnChangeColor2->blockSignals(
true );
1347 btnChangeColor2->blockSignals(
false );
1351 radioTwoColor->setChecked(
true );
1352 btnColorRamp->setEnabled(
false );
1356 radioColorRamp->setChecked(
true );
1357 btnChangeColor->setEnabled(
false );
1358 btnChangeColor2->setEnabled(
false );
1364 btnColorRamp->blockSignals(
true );
1366 btnColorRamp->blockSignals(
false );
1369 cboGradientType->blockSignals(
true );
1373 cboGradientType->setCurrentIndex( 0 );
1376 cboGradientType->setCurrentIndex( 1 );
1379 cboGradientType->setCurrentIndex( 2 );
1382 cboGradientType->blockSignals(
false );
1384 cboCoordinateMode->blockSignals(
true );
1388 cboCoordinateMode->setCurrentIndex( 1 );
1389 checkRefPoint1Centroid->setEnabled(
false );
1390 checkRefPoint2Centroid->setEnabled(
false );
1394 cboCoordinateMode->setCurrentIndex( 0 );
1397 cboCoordinateMode->blockSignals(
false );
1399 cboGradientSpread->blockSignals(
true );
1403 cboGradientSpread->setCurrentIndex( 0 );
1406 cboGradientSpread->setCurrentIndex( 1 );
1409 cboGradientSpread->setCurrentIndex( 2 );
1412 cboGradientSpread->blockSignals(
false );
1414 spinRefPoint1X->blockSignals(
true );
1416 spinRefPoint1X->blockSignals(
false );
1417 spinRefPoint1Y->blockSignals(
true );
1419 spinRefPoint1Y->blockSignals(
false );
1420 checkRefPoint1Centroid->blockSignals(
true );
1424 spinRefPoint1X->setEnabled(
false );
1425 spinRefPoint1Y->setEnabled(
false );
1427 checkRefPoint1Centroid->blockSignals(
false );
1428 spinRefPoint2X->blockSignals(
true );
1430 spinRefPoint2X->blockSignals(
false );
1431 spinRefPoint2Y->blockSignals(
true );
1433 spinRefPoint2Y->blockSignals(
false );
1434 checkRefPoint2Centroid->blockSignals(
true );
1438 spinRefPoint2X->setEnabled(
false );
1439 spinRefPoint2Y->setEnabled(
false );
1441 checkRefPoint2Centroid->blockSignals(
false );
1443 spinOffsetX->blockSignals(
true );
1445 spinOffsetX->blockSignals(
false );
1446 spinOffsetY->blockSignals(
true );
1448 spinOffsetY->blockSignals(
false );
1449 mSpinAngle->blockSignals(
true );
1451 mSpinAngle->blockSignals(
false );
1453 mOffsetUnitWidget->blockSignals(
true );
1456 mOffsetUnitWidget->blockSignals(
false );
1490void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1492 if ( radioTwoColor->isChecked() )
1505 if ( btnColorRamp->isNull() )
1519 spinRefPoint1X->setValue( 0.5 );
1520 spinRefPoint1Y->setValue( 0 );
1521 spinRefPoint2X->setValue( 0.5 );
1522 spinRefPoint2Y->setValue( 1 );
1527 spinRefPoint1X->setValue( 0 );
1528 spinRefPoint1Y->setValue( 0 );
1529 spinRefPoint2X->setValue( 1 );
1530 spinRefPoint2Y->setValue( 1 );
1534 spinRefPoint1X->setValue( 0.5 );
1535 spinRefPoint1Y->setValue( 0.5 );
1536 spinRefPoint2X->setValue( 1 );
1537 spinRefPoint2Y->setValue( 1 );
1552 checkRefPoint1Centroid->setEnabled(
true );
1553 checkRefPoint2Centroid->setEnabled(
true );
1559 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1560 checkRefPoint1Centroid->setEnabled(
false );
1561 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1562 checkRefPoint2Centroid->setEnabled(
false );
1587void QgsGradientFillSymbolLayerWidget::offsetChanged()
1589 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1593void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1602void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1608void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1626 connect( mSpinBlurRadius, qOverload< int >( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1627 connect( mSpinMaxDistance, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1629 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1631 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1637 QButtonGroup *group1 =
new QButtonGroup(
this );
1638 group1->addButton( radioColorRamp );
1639 group1->addButton( radioTwoColor );
1640 QButtonGroup *group2 =
new QButtonGroup(
this );
1641 group2->addButton( mRadioUseMaxDistance );
1642 group2->addButton( mRadioUseWholeShape );
1643 btnChangeColor->setAllowOpacity(
true );
1644 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1645 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1646 btnChangeColor->setShowNoColor(
true );
1647 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1648 btnChangeColor2->setAllowOpacity(
true );
1649 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1650 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1651 btnChangeColor2->setShowNoColor(
true );
1652 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1654 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1655 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1657 spinOffsetX->setClearValue( 0.0 );
1658 spinOffsetY->setClearValue( 0.0 );
1659 mSpinMaxDistance->setClearValue( 5.0 );
1661 btnColorRamp->setShowGradientOnly(
true );
1667 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1668 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1669 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1671 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1672 connect( mSpinBlurRadius,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1677 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1684 btnChangeColor->blockSignals(
true );
1686 btnChangeColor->blockSignals(
false );
1687 btnChangeColor2->blockSignals(
true );
1689 btnChangeColor2->blockSignals(
false );
1693 radioTwoColor->setChecked(
true );
1694 btnColorRamp->setEnabled(
false );
1698 radioColorRamp->setChecked(
true );
1699 btnChangeColor->setEnabled(
false );
1700 btnChangeColor2->setEnabled(
false );
1703 mSpinBlurRadius->blockSignals(
true );
1704 mBlurSlider->blockSignals(
true );
1707 mSpinBlurRadius->blockSignals(
false );
1708 mBlurSlider->blockSignals(
false );
1710 mSpinMaxDistance->blockSignals(
true );
1712 mSpinMaxDistance->blockSignals(
false );
1714 mRadioUseWholeShape->blockSignals(
true );
1715 mRadioUseMaxDistance->blockSignals(
true );
1718 mRadioUseWholeShape->setChecked(
true );
1719 mSpinMaxDistance->setEnabled(
false );
1720 mDistanceUnitWidget->setEnabled(
false );
1724 mRadioUseMaxDistance->setChecked(
true );
1725 mSpinMaxDistance->setEnabled(
true );
1726 mDistanceUnitWidget->setEnabled(
true );
1728 mRadioUseWholeShape->blockSignals(
false );
1729 mRadioUseMaxDistance->blockSignals(
false );
1731 mDistanceUnitWidget->blockSignals(
true );
1734 mDistanceUnitWidget->blockSignals(
false );
1736 mIgnoreRingsCheckBox->blockSignals(
true );
1737 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1738 mIgnoreRingsCheckBox->blockSignals(
false );
1743 btnColorRamp->blockSignals(
true );
1745 btnColorRamp->blockSignals(
false );
1748 spinOffsetX->blockSignals(
true );
1750 spinOffsetX->blockSignals(
false );
1751 spinOffsetY->blockSignals(
true );
1753 spinOffsetY->blockSignals(
false );
1754 mOffsetUnitWidget->blockSignals(
true );
1757 mOffsetUnitWidget->blockSignals(
false );
1791void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1798 if ( radioTwoColor->isChecked() )
1809void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1818void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1827void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1837void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1842 mDistanceUnitWidget->setEnabled( !value );
1847void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1857void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1861 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1866void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1877void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1879 const bool checked = ( state == Qt::Checked );
1908 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1917 spinOffset->setClearValue( 0.0 );
1918 mSpinOffsetAlongLine->setClearValue( 0.0 );
1919 mSpinAverageAngleLength->setClearValue( 4.0 );
1923 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1924 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1925 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1926 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1927 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1928 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1929 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1930 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1931 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1932 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1933 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
1945 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1952 spinInterval->blockSignals(
true );
1954 spinInterval->blockSignals(
false );
1955 mSpinOffsetAlongLine->blockSignals(
true );
1957 mSpinOffsetAlongLine->blockSignals(
false );
1958 chkRotateMarker->blockSignals(
true );
1960 chkRotateMarker->blockSignals(
false );
1961 spinOffset->blockSignals(
true );
1963 spinOffset->blockSignals(
false );
1978 mIntervalUnitWidget->blockSignals(
true );
1981 mIntervalUnitWidget->blockSignals(
false );
1982 mOffsetUnitWidget->blockSignals(
true );
1985 mOffsetUnitWidget->blockSignals(
false );
1986 mOffsetAlongLineUnitWidget->blockSignals(
true );
1989 mOffsetAlongLineUnitWidget->blockSignals(
false );
2020 mRingFilterComboBox->hide();
2021 mRingsLabel->hide();
2042void QgsMarkerLineSymbolLayerWidget::setRotate()
2044 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2045 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2051void QgsMarkerLineSymbolLayerWidget::setOffset()
2057void QgsMarkerLineSymbolLayerWidget::setPlacement()
2059 const bool interval = mCheckInterval->isChecked();
2060 spinInterval->setEnabled( interval );
2061 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2062 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2063 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2064 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2065 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2067 Qgis::MarkerLinePlacements placements;
2068 if ( mCheckInterval->isChecked() )
2070 if ( mCheckVertex->isChecked() )
2072 if ( mCheckVertexLast->isChecked() )
2074 if ( mCheckVertexFirst->isChecked() )
2076 if ( mCheckCurvePoint->isChecked() )
2078 if ( mCheckSegmentCentralPoint->isChecked() )
2080 if ( mCheckCentralPoint->isChecked() )
2087void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2097void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2107void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2117void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
2127void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2164 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2173 spinOffset->setClearValue( 0.0 );
2174 mSpinOffsetAlongLine->setClearValue( 0.0 );
2175 mHashRotationSpinBox->setClearValue( 0 );
2176 mSpinAverageAngleLength->setClearValue( 4.0 );
2178 connect( spinInterval,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2179 connect( mSpinOffsetAlongLine,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2180 connect( mSpinHashLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2181 connect( mHashRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2182 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2183 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2184 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2186 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2187 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2188 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2189 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2190 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2191 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2192 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2194 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
2206 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2213 spinInterval->blockSignals(
true );
2214 spinInterval->setValue( mLayer->
interval() );
2215 spinInterval->blockSignals(
false );
2216 mSpinOffsetAlongLine->blockSignals(
true );
2218 mSpinOffsetAlongLine->blockSignals(
false );
2221 chkRotateMarker->blockSignals(
true );
2223 chkRotateMarker->blockSignals(
false );
2224 spinOffset->blockSignals(
true );
2225 spinOffset->setValue( mLayer->
offset() );
2226 spinOffset->blockSignals(
false );
2241 mIntervalUnitWidget->blockSignals(
true );
2242 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2244 mIntervalUnitWidget->blockSignals(
false );
2245 mOffsetUnitWidget->blockSignals(
true );
2246 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2248 mOffsetUnitWidget->blockSignals(
false );
2249 mOffsetAlongLineUnitWidget->blockSignals(
true );
2252 mOffsetAlongLineUnitWidget->blockSignals(
false );
2259 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2286 mRingFilterComboBox->hide();
2287 mRingsLabel->hide();
2296void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2302void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2308void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2314void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2320void QgsHashedLineSymbolLayerWidget::setRotate()
2322 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2323 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2329void QgsHashedLineSymbolLayerWidget::setOffset()
2331 mLayer->
setOffset( spinOffset->value() );
2335void QgsHashedLineSymbolLayerWidget::setPlacement()
2337 const bool interval = mCheckInterval->isChecked();
2338 spinInterval->setEnabled( interval );
2339 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2340 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2341 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2342 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2343 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2345 Qgis::MarkerLinePlacements placements;
2346 if ( mCheckInterval->isChecked() )
2348 if ( mCheckVertex->isChecked() )
2350 if ( mCheckVertexLast->isChecked() )
2352 if ( mCheckVertexFirst->isChecked() )
2354 if ( mCheckCurvePoint->isChecked() )
2356 if ( mCheckSegmentCentralPoint->isChecked() )
2358 if ( mCheckCentralPoint->isChecked() )
2365void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2375void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2385void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2395void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2405void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2415void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2434 mSvgSelectorWidget->setAllowParameters(
true );
2435 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2436 mSvgSelectorWidget->sourceLineEdit()->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2437 mSvgSelectorWidget->initParametersModel(
this, vl );
2441 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2442 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2446 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2447 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2454 mChangeColorButton->setAllowOpacity(
true );
2455 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2456 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2457 mChangeStrokeColorButton->setAllowOpacity(
true );
2458 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2459 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2461 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2462 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2464 spinOffsetX->setClearValue( 0.0 );
2465 spinOffsetY->setClearValue( 0.0 );
2466 spinAngle->setClearValue( 0.0 );
2468 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2469 connect( spinHeight,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2471 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2472 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2473 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2484 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2485 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2492#include <QAbstractListModel>
2493#include <QPixmapCache>
2507 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2508 QColor defaultFill, defaultStroke;
2509 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2510 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2512 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2513 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2514 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2515 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2516 mChangeColorButton->setEnabled( hasFillParam );
2517 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2518 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2519 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2520 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2525 const double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2526 if ( hasDefaultFillColor && !skipDefaultColors )
2530 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2531 mChangeColorButton->setColor( fill );
2533 if ( hasStrokeParam )
2536 const double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2537 if ( hasDefaultStrokeColor && !skipDefaultColors )
2539 stroke = defaultStroke;
2541 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2542 mChangeStrokeColorButton->setColor( stroke );
2545 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( layer->
path() );
2547 mStrokeWidthSpinBox->blockSignals(
true );
2548 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2549 mStrokeWidthSpinBox->blockSignals(
false );
2552 spinHeight->blockSignals(
true );
2553 if ( preservedAspectRatio )
2562 spinHeight->blockSignals(
false );
2563 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2566void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2568 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2570 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2572 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2575 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2586 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2593 mSvgSelectorWidget->setSvgPath(
mLayer->
path() );
2596 spinWidth->blockSignals(
true );
2598 spinWidth->blockSignals(
false );
2599 spinAngle->blockSignals(
true );
2601 spinAngle->blockSignals(
false );
2604 spinOffsetX->blockSignals(
true );
2606 spinOffsetX->blockSignals(
false );
2607 spinOffsetY->blockSignals(
true );
2609 spinOffsetY->blockSignals(
false );
2611 mSizeUnitWidget->blockSignals(
true );
2614 mSizeUnitWidget->blockSignals(
false );
2615 mStrokeWidthUnitWidget->blockSignals(
true );
2618 mStrokeWidthUnitWidget->blockSignals(
false );
2619 mOffsetUnitWidget->blockSignals(
true );
2622 mOffsetUnitWidget->blockSignals(
false );
2625 mHorizontalAnchorComboBox->blockSignals(
true );
2626 mVerticalAnchorComboBox->blockSignals(
true );
2629 mHorizontalAnchorComboBox->blockSignals(
false );
2630 mVerticalAnchorComboBox->blockSignals(
false );
2646 updateAssistantSymbol();
2663 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2672 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2678void QgsSvgMarkerSymbolLayerWidget::setWidth()
2681 double fixedAspectRatio = 0.0;
2682 spinHeight->blockSignals(
true );
2683 if ( defaultAspectRatio <= 0.0 )
2685 spinHeight->setValue( spinWidth->value() );
2687 else if ( mLockAspectRatio->locked() )
2689 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2693 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2695 spinHeight->blockSignals(
false );
2701void QgsSvgMarkerSymbolLayerWidget::setHeight()
2704 double fixedAspectRatio = 0.0;
2705 spinWidth->blockSignals(
true );
2706 if ( defaultAspectRatio <= 0.0 )
2708 spinWidth->setValue( spinHeight->value() );
2710 else if ( mLockAspectRatio->locked() )
2712 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2716 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2718 spinWidth->blockSignals(
false );
2724void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2728 if ( defaultAspectRatio <= 0.0 )
2744void QgsSvgMarkerSymbolLayerWidget::setAngle()
2750void QgsSvgMarkerSymbolLayerWidget::setOffset()
2752 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2756void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2763void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2774void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2785void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2794void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2804void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2814void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2824void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2833void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2849 mSvgSelectorWidget->setAllowParameters(
true );
2850 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2852 connect( mTextureWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2854 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2856 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2857 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2865 mRotationSpinBox->setClearValue( 0.0 );
2867 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2868 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2869 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2870 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2872 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2873 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2886 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2895 mTextureWidthSpinBox->blockSignals(
true );
2896 mTextureWidthSpinBox->setValue( width );
2897 mTextureWidthSpinBox->blockSignals(
false );
2899 mRotationSpinBox->blockSignals(
true );
2901 mRotationSpinBox->blockSignals(
false );
2902 mTextureWidthUnitWidget->blockSignals(
true );
2905 mTextureWidthUnitWidget->blockSignals(
false );
2906 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2909 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2910 mChangeColorButton->blockSignals(
true );
2912 mChangeColorButton->blockSignals(
false );
2913 mChangeStrokeColorButton->blockSignals(
true );
2915 mChangeStrokeColorButton->blockSignals(
false );
2916 mStrokeWidthSpinBox->blockSignals(
true );
2918 mStrokeWidthSpinBox->blockSignals(
false );
2942void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2951void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2963void QgsSVGFillSymbolLayerWidget::setFile(
const QString &name )
2966 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2972void QgsSVGFillSymbolLayerWidget::setSvgParameters(
const QMap<QString, QgsProperty> ¶meters )
2975 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2982void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2994 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2995 QColor defaultFill, defaultStroke;
2996 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2997 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2999 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
3000 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
3001 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
3002 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
3005 QColor fill = mChangeColorButton->color();
3006 const double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
3007 if ( hasDefaultFillColor )
3011 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
3012 mChangeColorButton->setColor( fill );
3014 mChangeColorButton->setEnabled( hasFillParam );
3015 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
3018 QColor stroke = mChangeStrokeColorButton->color();
3019 const double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
3020 if ( hasDefaultStrokeColor )
3022 stroke = defaultStroke;
3024 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
3025 mChangeStrokeColorButton->setColor( stroke );
3027 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
3028 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
3029 if ( hasDefaultStrokeWidth && resetValues )
3031 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
3033 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
3036void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
3047void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
3058void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3067void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
3077void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
3093 connect( mAngleSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
3094 connect( mDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
3095 connect( mOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
3102 mOffsetSpinBox->setClearValue( 0 );
3103 mAngleSpinBox->setClearValue( 0 );
3107 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3119 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3132 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3146 mDistanceUnitWidget->blockSignals(
true );
3149 mDistanceUnitWidget->blockSignals(
false );
3150 mOffsetUnitWidget->blockSignals(
true );
3153 mOffsetUnitWidget->blockSignals(
false );
3171void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3180void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3189void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3198void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3208void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3224 connect( mHorizontalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3225 connect( mVerticalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3226 connect( mHorizontalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3227 connect( mVerticalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3228 connect( mHorizontalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3229 connect( mVerticalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3230 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3231 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3232 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3233 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3234 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3235 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3253 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3264 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3273 mSeedSpinBox->setShowClearButton(
true );
3274 mSeedSpinBox->setClearValue( 0 );
3275 mRandomXSpinBox->setClearValue( 0 );
3276 mRandomYSpinBox->setClearValue( 0 );
3282 connect( mRandomXSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3290 connect( mRandomYSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3316 connect( mSeedSpinBox, qOverload< int > ( &QSpinBox::valueChanged ),
this, [ = ](
int v )
3325 mAngleSpinBox->setShowClearButton(
true );
3326 mAngleSpinBox->setClearValue( 0 );
3327 connect( mAngleSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3339 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3353 mHorizontalDistanceUnitWidget->blockSignals(
true );
3356 mHorizontalDistanceUnitWidget->blockSignals(
false );
3357 mVerticalDistanceUnitWidget->blockSignals(
true );
3360 mVerticalDistanceUnitWidget->blockSignals(
false );
3361 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3364 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3365 mVerticalDisplacementUnitWidget->blockSignals(
true );
3368 mVerticalDisplacementUnitWidget->blockSignals(
false );
3369 mHorizontalOffsetUnitWidget->blockSignals(
true );
3372 mHorizontalOffsetUnitWidget->blockSignals(
false );
3373 mVerticalOffsetUnitWidget->blockSignals(
true );
3376 mVerticalOffsetUnitWidget->blockSignals(
false );
3408void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3417void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3426void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3435void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3444void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3453void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3462void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3472void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3482void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3492void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3502void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3512void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3533 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3534 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3535 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3545 scrollArea->setVerticalOnly(
true );
3547 btnColor->setAllowOpacity(
true );
3548 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3549 btnColor->setContext( QStringLiteral(
"symbology" ) );
3550 btnStrokeColor->setAllowOpacity(
true );
3551 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3552 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3554 mColorDDBtn->registerLinkedWidget( btnColor );
3555 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3557 spinOffsetX->setClearValue( 0.0 );
3558 spinOffsetY->setClearValue( 0.0 );
3559 spinAngle->setClearValue( 0.0 );
3565 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3568 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3570 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3573 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3575 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3576 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3587 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3596 mFontStyleComboBox->blockSignals(
true );
3597 populateFontStyleComboBox();
3598 mFontStyleComboBox->blockSignals(
false );
3616 mCharPreview->
setFont( mRefFont );
3622 mSizeUnitWidget->blockSignals(
true );
3625 mSizeUnitWidget->blockSignals(
false );
3627 mStrokeWidthUnitWidget->blockSignals(
true );
3630 mStrokeWidthUnitWidget->blockSignals(
false );
3632 mOffsetUnitWidget->blockSignals(
true );
3635 mOffsetUnitWidget->blockSignals(
false );
3656 updateAssistantSymbol();
3671 mCharPreview->setFont( mRefFont );
3672 populateFontStyleComboBox();
3677void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3684 mCharPreview->setFont( mRefFont );
3716 mCharPreview->setText( text );
3718 if ( text.isEmpty() )
3722 QString character = text;
3723 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3726 const unsigned int value = text.toUInt( &ok, 0 );
3729 character = QChar( value );
3730 mCharPreview->setText( character );
3751 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3753 mCharLineEdit->insert( chr );
3759 mCharPreview->setText( chr );
3763void QgsFontMarkerSymbolLayerWidget::setOffset()
3765 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3769void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3775void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3785void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3795void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3805void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3807 mFontStyleComboBox->clear();
3808 const QStringList styles = mFontDB.styles( mRefFont.family() );
3809 const auto constStyles = styles;
3810 for (
const QString &style : constStyles )
3812 mFontStyleComboBox->addItem( style );
3815 QString targetStyle = mFontDB.styleString( mRefFont );
3816 if ( !styles.contains( targetStyle ) )
3819 targetStyle = QFontInfo( f ).styleName();
3820 mRefFont.setStyleName( targetStyle );
3823 const int stylIndx = mFontStyleComboBox->findText( targetStyle );
3824 if ( stylIndx > -1 )
3829 mFontStyleComboBox->setCurrentIndex( curIndx );
3832void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3835 setFontStyle( mFontStyleComboBox->currentText() );
3838void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3847void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3856void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3865void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3867 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3869 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3871 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3874 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3886 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3887 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3888 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3889 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3894 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3912void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3918void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3924void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3930void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3945 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3949 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3951 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3952 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3960 mSpinOffsetX->setClearValue( 0.0 );
3961 mSpinOffsetY->setClearValue( 0.0 );
3962 mRotationSpinBox->setClearValue( 0.0 );
3964 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3965 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3968 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3969 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3979 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3990 mHeightSpinBox->blockSignals(
true );
3991 if ( preservedAspectRatio )
4000 mHeightSpinBox->blockSignals(
false );
4001 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4009 mSizeUnitWidget->blockSignals(
true );
4012 mSizeUnitWidget->blockSignals(
false );
4013 mOffsetUnitWidget->blockSignals(
true );
4016 mOffsetUnitWidget->blockSignals(
false );
4031 updatePreviewImage();
4045void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4048 updatePreviewImage();
4052void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
4054 bool fitsInCache =
false;
4056 if ( image.isNull() )
4058 mLabelImagePreview->setPixmap( QPixmap() );
4062 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4063 previewImage.fill( Qt::transparent );
4064 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4066 p.begin( &previewImage );
4068 uchar pixDataRGB[] = { 150, 150, 150, 150,
4073 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4074 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4075 QBrush checkerBrush;
4076 checkerBrush.setTexture( pix );
4077 p.fillRect( imageRect, checkerBrush );
4084 p.drawImage( imageRect.left(), imageRect.top(), image );
4086 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4089void QgsRasterMarkerSymbolLayerWidget::setWidth()
4092 double fixedAspectRatio = 0.0;
4093 mHeightSpinBox->blockSignals(
true );
4094 if ( defaultAspectRatio <= 0.0 )
4096 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4098 else if ( mLockAspectRatio->locked() )
4100 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4104 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4106 mHeightSpinBox->blockSignals(
false );
4112void QgsRasterMarkerSymbolLayerWidget::setHeight()
4115 double fixedAspectRatio = 0.0;
4116 mWidthSpinBox->blockSignals(
true );
4117 if ( defaultAspectRatio <= 0.0 )
4119 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4121 else if ( mLockAspectRatio->locked() )
4123 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4127 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4129 mWidthSpinBox->blockSignals(
false );
4135void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4138 if ( defaultAspectRatio <= 0.0 )
4153void QgsRasterMarkerSymbolLayerWidget::setAngle()
4159void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
4163 updatePreviewImage();
4166void QgsRasterMarkerSymbolLayerWidget::setOffset()
4168 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4172void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4182void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4192void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4201void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4220 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastAnimatedMarkerImageDir" ) );
4224 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setAngle );
4226 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setWidth );
4227 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setHeight );
4230 mFrameRateSpin->setClearValue( 10 );
4231 mFrameRateSpin->setShowClearButton(
true );
4232 connect( mFrameRateSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
4243 mSpinOffsetX->setClearValue( 0.0 );
4244 mSpinOffsetY->setClearValue( 0.0 );
4245 mRotationSpinBox->setClearValue( 0.0 );
4247 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4248 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4251 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
4252 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
4262 if ( layer->
layerType() != QLatin1String(
"AnimatedMarker" ) )
4272 if ( firstFrameTime > 0 )
4274 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4278 mFrameRateSpin->setClearValue( 10 );
4283 mHeightSpinBox->blockSignals(
true );
4284 if ( preservedAspectRatio )
4293 mHeightSpinBox->blockSignals(
false );
4294 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4304 mSizeUnitWidget->blockSignals(
true );
4307 mSizeUnitWidget->blockSignals(
false );
4308 mOffsetUnitWidget->blockSignals(
true );
4311 mOffsetUnitWidget->blockSignals(
false );
4326 updatePreviewImage();
4340void QgsAnimatedMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4345 if ( firstFrameTime > 0 )
4347 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4351 mFrameRateSpin->setClearValue( 10 );
4353 updatePreviewImage();
4357void QgsAnimatedMarkerSymbolLayerWidget::updatePreviewImage()
4359 if ( mPreviewMovie )
4361 mLabelImagePreview->setMovie(
nullptr );
4362 mPreviewMovie->deleteLater();
4363 mPreviewMovie =
nullptr;
4366 mPreviewMovie =
new QMovie(
mLayer->
path(), QByteArray(),
this );
4367 mPreviewMovie->setScaledSize( QSize( 150, 150 ) );
4368 mLabelImagePreview->setMovie( mPreviewMovie );
4369 mPreviewMovie->start();
4372void QgsAnimatedMarkerSymbolLayerWidget::setWidth()
4375 double fixedAspectRatio = 0.0;
4376 mHeightSpinBox->blockSignals(
true );
4377 if ( defaultAspectRatio <= 0.0 )
4379 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4381 else if ( mLockAspectRatio->locked() )
4383 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4387 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4389 mHeightSpinBox->blockSignals(
false );
4395void QgsAnimatedMarkerSymbolLayerWidget::setHeight()
4398 double fixedAspectRatio = 0.0;
4399 mWidthSpinBox->blockSignals(
true );
4400 if ( defaultAspectRatio <= 0.0 )
4402 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4404 else if ( mLockAspectRatio->locked() )
4406 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4410 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4412 mWidthSpinBox->blockSignals(
false );
4418void QgsAnimatedMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4421 if ( defaultAspectRatio <= 0.0 )
4436void QgsAnimatedMarkerSymbolLayerWidget::setAngle()
4442void QgsAnimatedMarkerSymbolLayerWidget::setOpacity(
double value )
4446 updatePreviewImage();
4449void QgsAnimatedMarkerSymbolLayerWidget::setOffset()
4451 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4455void QgsAnimatedMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4465void QgsAnimatedMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4475void QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4484void QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4501 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4505 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
4518 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
4528 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
4543 mSpinOffsetX->setClearValue( 0.0 );
4544 mSpinOffsetY->setClearValue( 0.0 );
4545 mRotationSpinBox->setClearValue( 0.0 );
4547 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4548 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4549 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4561 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4574 cboCoordinateMode->blockSignals(
true );
4578 cboCoordinateMode->setCurrentIndex( 1 );
4582 cboCoordinateMode->setCurrentIndex( 0 );
4585 cboCoordinateMode->blockSignals(
false );
4591 mOffsetUnitWidget->blockSignals(
true );
4594 mOffsetUnitWidget->blockSignals(
false );
4597 mSizeUnitWidget->blockSignals(
true );
4600 mSizeUnitWidget->blockSignals(
false );
4604 updatePreviewImage();
4619void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4622 updatePreviewImage();
4626void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4643void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4652 updatePreviewImage();
4655void QgsRasterFillSymbolLayerWidget::offsetChanged()
4657 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4661void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4672void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4681void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4683 bool fitsInCache =
false;
4685 if ( image.isNull() )
4687 mLabelImagePreview->setPixmap( QPixmap() );
4691 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4692 previewImage.fill( Qt::transparent );
4693 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4695 p.begin( &previewImage );
4697 uchar pixDataRGB[] = { 150, 150, 150, 150,
4702 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4703 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4704 QBrush checkerBrush;
4705 checkerBrush.setTexture( pix );
4706 p.fillRect( imageRect, checkerBrush );
4713 p.drawImage( imageRect.left(), imageRect.top(), image );
4715 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4729 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4746 connect( spinWidth, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ]
4766 spinOffset->setClearValue( 0.0 );
4767 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
4776 connect( cboCapStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4784 connect( cboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4799 updatePreviewImage();
4812 if ( layer->
layerType() != QLatin1String(
"RasterLine" ) )
4836 updatePreviewImage();
4851void QgsRasterLineSymbolLayerWidget::imageSourceChanged(
const QString &text )
4854 updatePreviewImage();
4858void QgsRasterLineSymbolLayerWidget::updatePreviewImage()
4860 bool fitsInCache =
false;
4862 if ( image.isNull() )
4864 mLabelImagePreview->setPixmap( QPixmap() );
4868 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4869 previewImage.fill( Qt::transparent );
4870 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4872 p.begin( &previewImage );
4874 uchar pixDataRGB[] = { 150, 150, 150, 150,
4879 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4880 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4881 QBrush checkerBrush;
4882 checkerBrush.setTexture( pix );
4883 p.fillRect( imageRect, checkerBrush );
4890 p.drawImage( imageRect.left(), imageRect.top(), image );
4892 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4906 modificationExpressionSelector->setMultiLine(
true );
4907 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4908 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4919 mUnitWidget->setShowMapScaleButton(
false );
4922 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4925 if ( !mBlockSignals )
4927 mLayer->
setUnits( mUnitWidget->unit() );
4938 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData(
static_cast< int >( mLayer->
symbolType() ) ) );
4939 mUnitWidget->setUnit( mLayer->
units() );
4948void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4955void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4958 std::unique_ptr< QgsSymbol > subSymbol( mLayer->
subSymbol()->
clone() );
4973 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4976 layers << subSymbol->symbolLayer( i )->clone();
4979 if ( !layers.empty() )
4989 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4990 layers << subSymbol->symbolLayer( i )->clone();
5012 mPointCountSpinBox->setShowClearButton(
true );
5013 mPointCountSpinBox->setClearValue( 100 );
5014 mSeedSpinBox->setShowClearButton(
true );
5015 mSeedSpinBox->setClearValue( 0 );
5017 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
5018 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
5019 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
5020 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
5021 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
5038 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
5048 bool showDensityBasedCountWidgets =
false;
5052 showDensityBasedCountWidgets =
true;
5057 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5058 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5059 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5060 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5062 whileBlocking( mCountMethodComboBox )->setCurrentIndex( mCountMethodComboBox->findData(
static_cast< int >( mLayer->
countMethod() ) ) );
5064 mDensityAreaUnitWidget->blockSignals(
true );
5067 mDensityAreaUnitWidget->blockSignals(
false );
5080void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
5083 bool showDensityBasedCountWidgets =
false;
5087 showDensityBasedCountWidgets =
true;
5092 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5093 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5094 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5095 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5104void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
5113void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
5122void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
5132void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
5151 btnColorRamp->setShowGradientOnly(
true );
5153 btnChangeColor->setAllowOpacity(
true );
5154 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5155 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
5156 btnChangeColor->setShowNoColor(
true );
5157 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
5158 btnChangeColor2->setAllowOpacity(
true );
5159 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5160 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
5161 btnChangeColor2->setShowNoColor(
true );
5162 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
5164 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
5165 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
5185 if ( btnColorRamp->isNull() )
5195 connect( radioTwoColor, &QAbstractButton::toggled,
this, [ = ]
5199 if ( radioTwoColor->isChecked() )
5201 mLayer->setGradientColorType( Qgis::GradientColorSource::SimpleTwoColor );
5202 btnChangeColor->setEnabled( true );
5203 btnChangeColor2->setEnabled( true );
5204 btnColorRamp->setEnabled( false );
5208 mLayer->setGradientColorType( Qgis::GradientColorSource::ColorRamp );
5209 btnColorRamp->setEnabled( true );
5210 btnChangeColor->setEnabled( false );
5211 btnChangeColor2->setEnabled( false );
5232 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ]
5251 spinOffset->setClearValue( 0.0 );
5252 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
5261 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5269 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5286 if ( layer->
layerType() != QLatin1String(
"Lineburst" ) )
5297 btnChangeColor->blockSignals(
true );
5299 btnChangeColor->blockSignals(
false );
5300 btnChangeColor2->blockSignals(
true );
5302 btnChangeColor2->blockSignals(
false );
5306 radioTwoColor->setChecked(
true );
5307 btnColorRamp->setEnabled(
false );
5311 radioColorRamp->setChecked(
true );
5312 btnChangeColor->setEnabled(
false );
5313 btnChangeColor2->setEnabled(
false );
5319 btnColorRamp->blockSignals(
true );
5321 btnColorRamp->blockSignals(
false );
5373 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ]
5377 mLayer->
setWidth( spinWidth->value() );
5392 spinOffset->setClearValue( 0.0 );
5393 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
5402 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5410 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5429 if ( layer->
layerType() != QLatin1String(
"FilledLine" ) )
@ 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.
@ Absolute
The point count is used as an absolute count of markers.
@ DensityBased
The point count is part of a marker density count.
MarkerShape
Marker shapes.
@ Percentage
Percentage of another measurement (e.g., canvas size, feature size)
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
@ MetersInMapUnits
Meters value as Map units.
@ Conical
Conical (polar) gradient.
@ Radial
Radial (circular) gradient.
SymbolType
Attribute editing capabilities which may be supported by vector data providers.
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.
Animated marker symbol layer class.
void setFrameRate(double rate)
Sets the marker frame rate in frame per second.
double frameRate() const
Returns the marker frame rate in frame per second.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QgsImageCache * imageCache()
Returns the application's image cache, used for caching resampled versions of raster images.
static QgsSvgCache * svgCache()
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement w...
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
bool exists(const QgsPropertyDefinition &definition) const
Returns true if the property is stored in the layer already, false otherwise.
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool pointOnSurface() const
void setClipOnCurrentPartOnly(bool clipOnCurrentPartOnly)
Sets whether point markers should be clipped to the current part boundary only.
void setClipPoints(bool clipPoints)
Sets whether point markers should be clipped to the polygon boundary.
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
bool clipOnCurrentPartOnly() const
Returns true if point markers should be clipped to the current part boundary only.
void setPointOnSurface(bool pointOnSurface)
Abstract base class for color ramps.
A dialog to enter a custom dash space pattern for lines.
Single scope for storing variables and functions for use within a QgsExpressionContext.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
static const QString EXPR_CLUSTER_SIZE
Inbuilt variable name for cluster size variable.
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
static const QString EXPR_GEOMETRY_RING_NUM
Inbuilt variable name for geometry ring number variable.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
QgsExpressionContextScope * lastScope()
Returns the last scope added to the context.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
bool hasVariable(const QString &name) const
Check whether a variable is specified by any scope within the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
static const QString EXPR_CLUSTER_COLOR
Inbuilt variable name for cluster color variable.
void expressionChanged(const QString &expression)
Emitted when the expression is changed.
double angle() const
Returns the rotation angle of the fill symbol, in degrees clockwise.
void setAngle(double angle)
Sets the rotation angle of the pattern, in degrees clockwise.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol layer type which fills a stroked line with a QgsFillSymbol.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
void setMapUnitScale(const QgsMapUnitScale &scale) override
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
QgsFilledMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the stroke width unit.
void setStrokeColor(const QColor &color) override
Sets the stroke color for the symbol layer.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
Qgis::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
double strokeWidth() const
Returns the marker's stroke width.
void setFontStyle(const QString &style)
Sets the font style for the font which will be used to render the point.
QString fontStyle() const
Returns the font style for the associated font which will be used to render the point.
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point.
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
void setStrokeWidth(double width)
Set's the marker's stroke width.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
QgsFontMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
QString character() const
Returns the character(s) used when rendering points.
static QString translateNamedStyle(const QString &namedStyle)
Returns the localized named style of a font, if such a translation is available.
static QString untranslateNamedStyle(const QString &namedStyle)
Returns the english named style of a font, if possible.
static QFont createFont(const QString &family, int pointSize=-1, int weight=-1, bool italic=false)
Creates a font with the specified family.
static bool updateFontViaStyle(QFont &f, const QString &fontstyle, bool fallback=false)
Updates font with named style and retain all font properties.
static void setFontFamily(QFont &font, const QString &family)
Sets the family for a font object.
Qgis::RenderUnit units() const
Returns the unit for the geometry expression.
QString geometryExpression() const
Gets the expression to generate this geometry.
void setUnits(Qgis::RenderUnit units)
Sets the units for the geometry expression.
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
void setSymbolType(Qgis::SymbolType symbolType)
Set the type of symbol which should be created.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
Qgis::SymbolType symbolType() const
Access the symbol type.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient fill.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
void setGradientSpread(Qgis::GradientSpread gradientSpread)
Sets the gradient spread mode, which controls how the gradient behaves outside of the predefined stop...
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
Qgis::SymbolCoordinateReference coordinateMode() const
Returns the coordinate mode for gradient, which controls how the gradient stops are positioned.
bool referencePoint2IsCentroid() const
Returns whether the end point for the gradient is taken from the feature centroid.
void setGradientType(Qgis::GradientType gradientType)
Sets the type of gradient, e.g., linear or radial.
void setReferencePoint2(QPointF referencePoint)
Sets the end point of gradient fill, in the range [0,0] - [1,1].
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void setCoordinateMode(Qgis::SymbolCoordinateReference coordinateMode)
Sets the coordinate mode for gradient, which controls how the gradient stops are positioned.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets whether the end point for the gradient is taken from the feature centroid.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets whether the starting point for the gradient is taken from the feature centroid.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setGradientColorType(Qgis::GradientColorSource gradientColorType)
Sets the gradient color mode, which controls how gradient color stops are created.
QPointF referencePoint1() const
Returns the starting point of gradient fill, in the range [0,0] - [1,1].
Qgis::GradientSpread gradientSpread() const
Returns the gradient spread mode, which controls how the gradient behaves outside of the predefined s...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setReferencePoint1(QPointF referencePoint)
Sets the starting point of gradient fill, in the range [0,0] - [1,1].
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::GradientType gradientType() const
Returns the type of gradient, e.g., linear or radial.
bool referencePoint1IsCentroid() const
Returns whether the starting point for the gradient is taken from the feature centroid.
QPointF referencePoint2() const
Returns the end point of gradient fill, in the range [0,0] - [1,1].
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
Line symbol layer type which draws repeating line sections along a line feature.
void setHashLength(double length)
Sets the length of hash symbols.
double hashAngle() const
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Qgis::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
double hashLength() const
Returns the length of hash symbols.
void setHashLengthUnit(Qgis::RenderUnit unit)
Sets the unit for the length of hash symbols.
void setHashAngle(double angle)
Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.
static QIcon iconLine()
Returns an icon representing line geometries.
static QIcon iconPolygon()
Returns an icon representing polygon geometries.
static QIcon iconPoint()
Returns an icon representing point geometries.
int nextFrameDelay(const QString &path, int currentFrame=0, bool blocking=false)
For image formats that support animation, this function returns the number of milliseconds to wait un...
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false, double targetDpi=96, int frameNumber=-1, bool *isMissing=nullptr)
Returns the specified path rendered as an image.
Qgis::SymbolCoordinateReference coordinateReference() const
Returns the coordinate reference mode for fill which controls how the top left corner of the image fi...
void setCoordinateReference(Qgis::SymbolCoordinateReference coordinateReference)
Sets the coordinate reference mode for fill which controls how the top left corner of the image fill ...
A symbol fill consisting of repeated parallel lines.
Qgis::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
Qgis::LineClipMode clipMode() const
Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
void setClipMode(Qgis::LineClipMode mode)
Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line pattern's offset.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
double distance() const
Returns the distance between lines in the fill pattern.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
Qgis::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
const QgsMapUnitScale & widthMapUnitScale() const
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
@ ExteriorRingOnly
Render the exterior ring only.
@ InteriorRingsOnly
Render the interior rings only.
@ AllRings
Render both exterior and interior rings.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setOffset(double offset)
Sets the line's offset.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line's offset.
void setWidthUnit(Qgis::RenderUnit unit)
Sets the units for the line's width.
virtual double width() const
Returns the estimated width for the line symbol layer.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
double offset() const
Returns the line's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
Qgis::RenderUnit offsetUnit() const
Returns the units for the line's offset.
Qgis::RenderUnit widthUnit() const
Returns the units for the line's width.
A line symbol type, for rendering LineString and MultiLineString geometries.
Line symbol layer type which draws a gradient pattern perpendicularly along a line.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient line.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient line.
Struct for storing maximum and minimum scales for measurements in map units.
Line symbol layer type which draws repeating marker symbols along a line feature.
virtual void setSize(double size)
Sets the symbol size.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's offset.
void setAngle(double angle)
Sets the rotation angle for the marker.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
double size() const
Returns the symbol size.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
Qgis::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
Qgis::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's size.
VerticalAnchorPoint
Symbol vertical anchor points.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
A marker symbol type, for rendering Point and MultiPoint geometries.
A dialog to create a new auxiliary field.
A dialog to create a new auxiliary layer.
A fill symbol layer which fills polygon shapes with repeating marker symbols.
const QgsMapUnitScale & distanceYMapUnitScale() const
Returns the map unit scale for the vertical distance between points in the pattern.
void setDisplacementX(double d)
Sets the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
Qgis::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationXMapUnitScale() const
Returns the unit scale for the horizontal random deviation of points in the pattern.
void setOffsetX(double offset)
Sets the horizontal offset values for points in the pattern.
double maximumRandomDeviationY() const
Returns the maximum vertical random deviation of points in the pattern.
void setDistanceYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical distance between points in the pattern.
double distanceX() const
Returns the horizontal distance between rendered markers in the fill.
Qgis::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of points in the pattern.
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
void setDisplacementYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setRandomDeviationYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical random deviation of points in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
Returns the map unit scale for the horizontal distance between points in the pattern.
void setRandomDeviationYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical random deviation of points in the pattern.
unsigned long seed() const
Returns the random number seed to use when randomly shifting points, or 0 if a truly random sequence ...
Qgis::MarkerClipMode clipMode() const
Returns the marker clipping mode, which defines how markers are clipped at the edges of shapes.
void setRandomDeviationXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal random deviation of points in the pattern.
Qgis::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
double offsetY() const
Returns the vertical offset values for points in the pattern.
void setDisplacementY(double d)
Sets the vertical displacement for odd numbered columns in the pattern.
void setMaximumRandomDeviationX(double deviation)
Sets the maximum horizontal random deviation of points in the pattern.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setSeed(unsigned long seed)
Sets the random number seed to use when randomly shifting points, or 0 if a truly random sequence wil...
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal offset for rows in the pattern.
const QgsMapUnitScale & displacementXMapUnitScale() const
Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal distance between points in the pattern.
Qgis::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
const QgsMapUnitScale & displacementYMapUnitScale() const
Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setDistanceXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal distance between points in the pattern.
void setOffsetYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationYMapUnitScale() const
Returns the unit scale for the vertical random deviation of points in the pattern.
Qgis::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setDistanceY(double d)
Sets the vertical distance between rendered markers in the fill.
Qgis::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
Qgis::RenderUnit randomDeviationXUnit() const
Returns the units for the horizontal random deviation of points in the pattern.
void setDisplacementXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDistanceX(double d)
Sets the horizontal distance between rendered markers in the fill.
double offsetX() const
Returns the horizontal offset values for points in the pattern.
void setRandomDeviationXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal random deviation of points in the pattern.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
void setMaximumRandomDeviationY(double deviation)
Sets the maximum vertical random deviation of points in the pattern.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical distance between points in the pattern.
Qgis::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
double displacementX() const
Returns the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
double distanceY() const
Returns the vertical distance between rendered markers in the fill.
void setClipMode(Qgis::MarkerClipMode mode)
Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.
QgsProperty property(int key) const final
Returns a matching property from the collection, if one exists.
Definition for a property.
A store for object properties.
void setField(const QString &field)
Sets the field name the property references.
A fill symbol layer which places markers at random locations within polygons.
int pointCount() const
Returns the count of random points to render in the fill.
unsigned long seed() const
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be...
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setCountMethod(Qgis::PointCountMethod method)
Sets the count method used to randomly fill the polygon.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
void setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
void setPointCount(int count)
Sets the count of random points to render in the fill.
Qgis::RenderUnit densityAreaUnit() const
Returns the units for the density area.
Qgis::PointCountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
void setDensityAreaUnit(Qgis::RenderUnit unit)
Sets the units for the density area.
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
double densityArea() const
Returns the density area used to count the number of points to randomly fill the polygon.
void setDensityArea(double area)
Sets the density area used to count the number of points to randomly fill the polygon.
A class for filling symbols with a repeated raster image.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the image's width and height.
double width() const
Returns the width used for scaling the image used in the fill.
void setOffsetUnit(const Qgis::RenderUnit unit)
Sets the units for the fill's offset.
void setHeight(double height)
Sets the height for scaling the image.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
double opacity() const
Returns the opacity for the raster image used in the fill.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the unit for the image's width and height.
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
Qgis::RenderUnit sizeUnit() const
Returns the units for the image's width and height.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QString imageFilePath() const
The path to the raster image used for the fill.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
double height() const
Returns the height used for scaling the image used in the fill.
void setWidth(double width)
Sets the width for scaling the image used in the fill.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width and height.
QPointF offset() const
Returns the offset for the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setOffset(QPointF offset)
Sets the offset for the fill.
void setCoordinateMode(Qgis::SymbolCoordinateReference mode)
Set the coordinate mode for fill.
Line symbol layer type which draws line sections using a raster image file.
double opacity() const
Returns the line opacity.
QString path() const
Returns the raster image path.
void setPath(const QString &path)
Set the raster image path.
void setOpacity(double opacity)
Set the line opacity.
Raster marker symbol layer class.
void setOpacity(double opacity)
Set the marker opacity.
QString path() const
Returns the marker raster image path.
void setPath(const QString &path)
Set the marker raster image path.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
double opacity() const
Returns the marker opacity.
A class for filling symbols with a repeated SVG file.
void setParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the dynamic SVG parameters.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setSvgStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the stroke width.
Qgis::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
void setPatternWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
void setSvgFilePath(const QString &svgPath)
Sets the path to the SVG file to render in the fill.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
Qgis::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
Stores properties relating to a screen.
Qgis::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
Qgis::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
QPointF offset() const
Returns the offset for the shapeburst fill.
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
const QgsMapUnitScale & offsetMapUnitScale() const
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setColorType(Qgis::GradientColorSource colorType)
Sets the color mode to use for the shapeburst fill.
Qgis::GradientColorSource colorType() const
Returns the color mode used for the shapeburst fill.
const QgsMapUnitScale & distanceMapUnitScale() const
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
Qt::PenJoinStyle penJoinStyle() const
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setBrushStyle(Qt::BrushStyle style)
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the width of the fill's stroke.
void setPenJoinStyle(Qt::PenJoinStyle style)
Qt::PenStyle strokeStyle() const
double strokeWidth() const
void setStrokeWidth(double strokeWidth)
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setStrokeStyle(Qt::PenStyle strokeStyle)
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setStrokeColor(const QColor &strokeColor) override
Sets the stroke color for the symbol layer.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qt::BrushStyle brushStyle() const
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
bool tweakDashPatternOnCorners() const
Returns true if dash patterns tweaks should be applied on sharp corners, to ensure that a double-leng...
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
const QgsMapUnitScale & trimDistanceEndMapUnitScale() const
Returns the map unit scale for the trim distance for the end of the line.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
const QgsMapUnitScale & trimDistanceStartMapUnitScale() const
Returns the map unit scale for the trim distance for the start of the line.
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for lengths used in the custom dash pattern.
void setTrimDistanceEndMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the end of the line.
void setTrimDistanceEnd(double distance)
Sets the trim distance for the end of the line, which dictates a length from the end of the line at w...
double trimDistanceStart() const
Returns the trim distance for the start of the line, which dictates a length from the start of the li...
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
void setTweakDashPatternOnCorners(bool enabled)
Sets whether dash patterns tweaks should be applied on sharp corners, to ensure that a double-length ...
Qgis::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
double trimDistanceEnd() const
Returns the trim distance for the end of the line, which dictates a length from the end of the line a...
Qgis::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
const QgsMapUnitScale & dashPatternOffsetMapUnitScale() const
Returns the map unit scale for the dash pattern offset value.
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
void setDashPatternOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the dash pattern offset.
QgsSimpleLineSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
double dashPatternOffset() const
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should sta...
void setAlignDashPattern(bool enabled)
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks...
void setTrimDistanceStartMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the start of the line.
Qgis::RenderUnit trimDistanceStartUnit() const
Returns the unit for the trim distance for the start of the line.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
void setTrimDistanceEndUnit(Qgis::RenderUnit unit)
Sets the unit for the trim distance for the end of the line.
void setDashPatternOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the dash pattern offset.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setTrimDistanceStart(double distance)
Sets the trim distance for the start of the line, which dictates a length from the start of the line ...
void setTrimDistanceStartUnit(Qgis::RenderUnit unit)
Sets the unit for the trim distance for the start of the line.
Qgis::RenderUnit trimDistanceEndUnit() const
Returns the unit for the trim distance for the end of the line.
bool alignDashPattern() const
Returns true if dash patterns should be aligned to the start and end of lines, by applying subtle twe...
void setCustomDashPatternUnit(Qgis::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
static QList< Qgis::MarkerShape > availableShapes()
Returns a list of all available shape types.
static bool shapeIsFilled(Qgis::MarkerShape shape)
Returns true if a symbol shape has a fill.
Qgis::MarkerShape shape() const
Returns the shape for the rendered marker symbol.
static QString encodeShape(Qgis::MarkerShape shape)
Encodes a shape to its string representation.
void setShape(Qgis::MarkerShape shape)
Sets the rendered marker shape.
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
void setColor(const QColor &color) override
Sets the "representative" color for the symbol layer.
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
void setStrokeWidthUnit(Qgis::RenderUnit u)
Sets the unit for the width of the marker's stroke.
QgsSimpleMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qt::PenCapStyle penCapStyle() const
Returns the marker's stroke cap style (e.g., flat, round, etc).
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's stroke.
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker's stroke style (e.g., solid, dashed, etc)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
QColor fillColor() const override
Returns the fill color for the symbol layer.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
QColor strokeColor() const override
Returns the marker's stroke color.
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
void setStrokeColor(const QColor &color) override
Sets the marker's stroke color.
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
Qgis::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the marker's stroke cap style (e.g., flat, round, etc).
double strokeWidth() const
Returns the width of the marker's stroke.
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam, double &defaultStrokeWidth, bool blocking=false) const
Tests if an SVG file contains parameters for fill, stroke color, stroke width.
QgsSvgMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
QColor fillColor() const override
Returns the fill color for the symbol layer.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
QString path() const
Returns the marker SVG path.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
void setStrokeWidth(double w)
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the stroke width.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
void setStrokeColor(const QColor &c) override
Sets the stroke color for the symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale) override
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setFillColor(const QColor &color) override
Sets the fill color for the symbol layer.
double strokeWidth() const
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
QMap< QString, QgsProperty > parameters() const
Returns the dynamic SVG parameters.
void setParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the dynamic SVG parameters.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
void setPath(const QString &path)
Set the marker SVG path.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
static QIcon symbolLayerPreviewIcon(const QgsSymbolLayer *layer, Qgis::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid, QgsMapLayer *mapLayer=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Draws a symbol layer preview to an icon.
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Returns a pixmap preview for a color ramp.
static QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr, const QgsScreenProperties &screen=QgsScreenProperties())
Returns an icon preview for a color ramp.
Property
Data definable properties.
@ GradientType
Gradient fill type.
@ SecondaryColor
Secondary color (eg for gradient fills)
@ File
Filename, eg for svg files.
@ VerticalAnchor
Vertical anchor point.
@ GradientReference2Y
Gradient reference point 2 y.
@ GradientReference1X
Gradient reference point 1 x.
@ OffsetY
Vertical offset.
@ OffsetX
Horizontal offset.
@ GradientReference1Y
Gradient reference point 1 y.
@ DashPatternOffset
Dash pattern offset,.
@ GradientSpread
Gradient spread mode.
@ OffsetAlongLine
Offset along line.
@ CustomDash
Custom dash pattern.
@ ShapeburstMaxDistance
Shapeburst fill from edge distance.
@ HorizontalAnchor
Horizontal anchor point.
@ StrokeStyle
Stroke style (eg solid, dashed)
@ Name
Name, eg shape name for simple markers.
@ DistanceY
Vertical distance between points.
@ DensityArea
Density area.
@ ClipPoints
Whether markers should be clipped to polygon boundaries.
@ LineClipping
Line clipping mode (since QGIS 3.24)
@ ShapeburstIgnoreRings
Shapeburst ignore rings.
@ Character
Character, eg for font marker symbol layers.
@ ShapeburstUseWholeShape
Shapeburst use whole shape.
@ DisplacementX
Horizontal displacement.
@ CoordinateMode
Gradient coordinate mode.
@ FillStyle
Fill style (eg solid, dots)
@ GradientReference2X
Gradient reference point 2 x.
@ StrokeColor
Stroke color.
@ TrimStart
Trim distance from start of line (since QGIS 3.20)
@ CapStyle
Line cap style.
@ BlurRadius
Shapeburst blur radius.
@ Placement
Line marker placement.
@ MarkerClipping
Marker clipping mode (since QGIS 3.24)
@ RandomSeed
Random number seed.
@ LineAngle
Line angle, or angle of hash lines for hash line symbols.
@ JoinStyle
Line join style.
@ RandomOffsetY
Random offset Y (since QGIS 3.24)
@ DisplacementY
Vertical displacement.
@ DistanceX
Horizontal distance between points.
@ AverageAngleLength
Length to average symbol angles over.
@ GradientReference1IsCentroid
Gradient reference point 1 is centroid.
@ Interval
Line marker interval.
@ StrokeWidth
Stroke width.
@ GradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ LineDistance
Distance between lines, or length of lines for hash line symbols.
@ RandomOffsetX
Random offset X (since QGIS 3.24)
@ TrimEnd
Trim distance from end of line (since QGIS 3.20)
virtual QString layerType() const =0
Returns a string that represents this layer type.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Qgis::SymbolType symbolType() const
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol...
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
bool placeOnEveryPart() const
Returns true if the placement applies for every part of multi-part feature geometries.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
void setMapUnitScale(const QgsMapUnitScale &scale) FINAL
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
void setIntervalUnit(Qgis::RenderUnit unit)
Sets the units for the interval between symbols.
void setAverageAngleUnit(Qgis::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
double interval() const
Returns the interval between individual symbols.
void setOffsetAlongLineUnit(Qgis::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
Qgis::MarkerLinePlacements placements() const
Returns the placement of the symbols.
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
Qgis::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
void setInterval(double interval)
Sets the interval between individual symbols.
Qgis::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
void setPlaceOnEveryPart(bool respect)
Sets whether the placement applies for every part of multi-part feature geometries.
void setPlacements(Qgis::MarkerLinePlacements placements)
Sets the placement of the symbols.
Qgis::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols.
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual symbo...
QList< Qgis::RenderUnit > RenderUnitList
List of render units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsSymbolLayer * > QgsSymbolLayerList
Single variable definition for use within a QgsExpressionContextScope.