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 );
4507 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
4514 mSpinOffsetX->setClearValue( 0.0 );
4515 mSpinOffsetY->setClearValue( 0.0 );
4516 mRotationSpinBox->setClearValue( 0.0 );
4518 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4519 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4520 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4532 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4545 cboCoordinateMode->blockSignals(
true );
4549 cboCoordinateMode->setCurrentIndex( 1 );
4553 cboCoordinateMode->setCurrentIndex( 0 );
4556 cboCoordinateMode->blockSignals(
false );
4562 mOffsetUnitWidget->blockSignals(
true );
4565 mOffsetUnitWidget->blockSignals(
false );
4568 mWidthUnitWidget->blockSignals(
true );
4571 mWidthUnitWidget->blockSignals(
false );
4573 updatePreviewImage();
4587void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4590 updatePreviewImage();
4594void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4611void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4620 updatePreviewImage();
4623void QgsRasterFillSymbolLayerWidget::offsetChanged()
4625 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4629void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4640void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4649void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4660void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4670void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4672 bool fitsInCache =
false;
4674 if ( image.isNull() )
4676 mLabelImagePreview->setPixmap( QPixmap() );
4680 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4681 previewImage.fill( Qt::transparent );
4682 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4684 p.begin( &previewImage );
4686 uchar pixDataRGB[] = { 150, 150, 150, 150,
4691 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4692 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4693 QBrush checkerBrush;
4694 checkerBrush.setTexture( pix );
4695 p.fillRect( imageRect, checkerBrush );
4702 p.drawImage( imageRect.left(), imageRect.top(), image );
4704 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4718 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4735 connect( spinWidth, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ]
4755 spinOffset->setClearValue( 0.0 );
4756 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
4765 connect( cboCapStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4773 connect( cboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4788 updatePreviewImage();
4801 if ( layer->
layerType() != QLatin1String(
"RasterLine" ) )
4825 updatePreviewImage();
4840void QgsRasterLineSymbolLayerWidget::imageSourceChanged(
const QString &text )
4843 updatePreviewImage();
4847void QgsRasterLineSymbolLayerWidget::updatePreviewImage()
4849 bool fitsInCache =
false;
4851 if ( image.isNull() )
4853 mLabelImagePreview->setPixmap( QPixmap() );
4857 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4858 previewImage.fill( Qt::transparent );
4859 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4861 p.begin( &previewImage );
4863 uchar pixDataRGB[] = { 150, 150, 150, 150,
4868 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4869 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4870 QBrush checkerBrush;
4871 checkerBrush.setTexture( pix );
4872 p.fillRect( imageRect, checkerBrush );
4879 p.drawImage( imageRect.left(), imageRect.top(), image );
4881 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4895 modificationExpressionSelector->setMultiLine(
true );
4896 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4897 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4908 mUnitWidget->setShowMapScaleButton(
false );
4911 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4914 if ( !mBlockSignals )
4916 mLayer->
setUnits( mUnitWidget->unit() );
4927 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData(
static_cast< int >( mLayer->
symbolType() ) ) );
4928 mUnitWidget->setUnit( mLayer->
units() );
4937void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4944void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4947 std::unique_ptr< QgsSymbol > subSymbol( mLayer->
subSymbol()->
clone() );
4962 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4965 layers << subSymbol->symbolLayer( i )->clone();
4968 if ( !layers.empty() )
4978 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4979 layers << subSymbol->symbolLayer( i )->clone();
5001 mPointCountSpinBox->setShowClearButton(
true );
5002 mPointCountSpinBox->setClearValue( 100 );
5003 mSeedSpinBox->setShowClearButton(
true );
5004 mSeedSpinBox->setClearValue( 0 );
5006 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
5007 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
5008 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
5009 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
5010 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
5027 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
5037 bool showDensityBasedCountWidgets =
false;
5041 showDensityBasedCountWidgets =
true;
5046 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5047 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5048 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5049 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5051 whileBlocking( mCountMethodComboBox )->setCurrentIndex( mCountMethodComboBox->findData(
static_cast< int >( mLayer->
countMethod() ) ) );
5053 mDensityAreaUnitWidget->blockSignals(
true );
5056 mDensityAreaUnitWidget->blockSignals(
false );
5069void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
5072 bool showDensityBasedCountWidgets =
false;
5076 showDensityBasedCountWidgets =
true;
5081 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5082 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5083 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5084 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5093void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
5102void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
5111void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
5121void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
5140 btnColorRamp->setShowGradientOnly(
true );
5142 btnChangeColor->setAllowOpacity(
true );
5143 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5144 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
5145 btnChangeColor->setShowNoColor(
true );
5146 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
5147 btnChangeColor2->setAllowOpacity(
true );
5148 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5149 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
5150 btnChangeColor2->setShowNoColor(
true );
5151 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
5153 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
5154 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
5174 if ( btnColorRamp->isNull() )
5184 connect( radioTwoColor, &QAbstractButton::toggled,
this, [ = ]
5188 if ( radioTwoColor->isChecked() )
5190 mLayer->setGradientColorType( Qgis::GradientColorSource::SimpleTwoColor );
5191 btnChangeColor->setEnabled( true );
5192 btnChangeColor2->setEnabled( true );
5193 btnColorRamp->setEnabled( false );
5197 mLayer->setGradientColorType( Qgis::GradientColorSource::ColorRamp );
5198 btnColorRamp->setEnabled( true );
5199 btnChangeColor->setEnabled( false );
5200 btnChangeColor2->setEnabled( false );
5221 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ]
5240 spinOffset->setClearValue( 0.0 );
5241 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
5250 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5258 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5275 if ( layer->
layerType() != QLatin1String(
"Lineburst" ) )
5286 btnChangeColor->blockSignals(
true );
5288 btnChangeColor->blockSignals(
false );
5289 btnChangeColor2->blockSignals(
true );
5291 btnChangeColor2->blockSignals(
false );
5295 radioTwoColor->setChecked(
true );
5296 btnColorRamp->setEnabled(
false );
5300 radioColorRamp->setChecked(
true );
5301 btnChangeColor->setEnabled(
false );
5302 btnChangeColor2->setEnabled(
false );
5308 btnColorRamp->blockSignals(
true );
5310 btnColorRamp->blockSignals(
false );
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
@ InnerVertices
Inner vertices (i.e. all vertices except the first and last vertex) (since QGIS 3....
@ LastVertex
Place symbols on the last vertex in the line.
@ CentralPoint
Place symbols at the mid point of the line.
@ SegmentCenter
Place symbols at the center of every line segment.
@ Vertex
Place symbols on every vertex in the line.
@ Interval
Place symbols at regular intervals.
@ FirstVertex
Place symbols on the first vertex in the line.
MarkerClipMode
Marker clipping modes.
@ CompletelyWithin
Render complete markers wherever the completely fall within the polygon shape.
@ NoClipping
No clipping, render complete markers.
@ Shape
Clip to polygon shape.
@ CentroidWithin
Render complete markers wherever their centroid falls within the polygon shape.
LineClipMode
Line clipping modes.
@ NoClipping
Lines are not clipped, will extend to shape's bounding box.
@ ClipPainterOnly
Applying clipping on the painter only (i.e. line endpoints will coincide with polygon bounding box,...
@ ClipToIntersection
Clip lines to intersection with polygon shape (slower) (i.e. line endpoints will coincide with polygo...
@ ColorRamp
Gradient color ramp.
@ SimpleTwoColor
Simple two color gradient.
@ Reflect
Reflect gradient.
@ Pad
Pad out gradient using colors at endpoint of gradient.
PointCountMethod
Methods which define the number of points randomly filling a polygon.
@ 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.
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 override
Returns a matching property from the collection, if one exists.
Definition for a property.
A store for object properties.
void setField(const QString &field)
Sets the field name the property references.
A fill symbol layer which places markers at random locations within polygons.
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.
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.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
void setWidthUnit(const Qgis::RenderUnit unit)
Sets the units for the image's width.
Qgis::RenderUnit widthUnit() const
Returns the units for the image's width.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
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 setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QString imageFilePath() const
The path to the raster image used for the fill.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
QPointF offset() const
Returns the offset for the fill.
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.
@ PropertyGradientReference1X
Gradient reference point 1 x.
@ PropertyShapeburstIgnoreRings
Shapeburst ignore rings.
@ PropertyGradientReference2X
Gradient reference point 2 x.
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
@ PropertyPlacement
Line marker placement.
@ PropertyHorizontalAnchor
Horizontal anchor point.
@ PropertyDistanceX
Horizontal distance between points.
@ PropertyFile
Filename, eg for svg files.
@ PropertyGradientType
Gradient fill type.
@ PropertyCapStyle
Line cap style.
@ PropertyAngle
Symbol angle.
@ PropertyLineClipping
Line clipping mode (since QGIS 3.24)
@ PropertyDistanceY
Vertical distance between points.
@ PropertyDisplacementX
Horizontal displacement.
@ PropertyVerticalAnchor
Vertical anchor point.
@ PropertyGradientSpread
Gradient spread mode.
@ PropertyOffsetY
Vertical offset.
@ PropertyGradientReference1Y
Gradient reference point 1 y.
@ PropertyLineDistance
Distance between lines, or length of lines for hash line symbols.
@ PropertyOffsetAlongLine
Offset along line.
@ PropertyBlurRadius
Shapeburst blur radius.
@ PropertyGradientReference2Y
Gradient reference point 2 y.
@ PropertyMarkerClipping
Marker clipping mode (since QGIS 3.24)
@ PropertyDensityArea
Density area.
@ PropertyGradientReference1IsCentroid
Gradient reference point 1 is centroid.
@ PropertyCustomDash
Custom dash pattern.
@ PropertyShapeburstUseWholeShape
Shapeburst use whole shape.
@ PropertySize
Symbol size.
@ PropertyOffsetX
Horizontal offset.
@ PropertyJoinStyle
Line join style.
@ PropertyTrimEnd
Trim distance from end of line (since QGIS 3.20)
@ PropertyOpacity
Opacity.
@ PropertySecondaryColor
Secondary color (eg for gradient fills)
@ PropertyCharacter
Character, eg for font marker symbol layers.
@ PropertyCoordinateMode
Gradient coordinate mode.
@ PropertyRandomOffsetY
Random offset Y (since QGIS 3.24)
@ PropertyLineAngle
Line angle, or angle of hash lines for hash line symbols.
@ PropertyShapeburstMaxDistance
Shapeburst fill from edge distance.
@ PropertyTrimStart
Trim distance from start of line (since QGIS 3.20)
@ PropertyOffset
Symbol offset.
@ PropertyStrokeWidth
Stroke width.
@ PropertyDashPatternOffset
Dash pattern offset,.
@ PropertyFillColor
Fill color.
@ PropertyFontStyle
Font style.
@ PropertyHeight
Symbol height.
@ PropertyClipPoints
Whether markers should be clipped to polygon boundaries.
@ PropertyFontFamily
Font family.
@ PropertyPointCount
Point count.
@ PropertyRandomSeed
Random number seed.
@ PropertyName
Name, eg shape name for simple markers.
@ PropertyAverageAngleLength
Length to average symbol angles over.
@ PropertyInterval
Line marker interval.
@ PropertyRandomOffsetX
Random offset X (since QGIS 3.24)
@ PropertyFillStyle
Fill style (eg solid, dots)
@ PropertyDisplacementY
Vertical displacement.
@ PropertyStrokeColor
Stroke color.
@ PropertyGradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ PropertyWidth
Symbol width.
virtual QString layerType() const =0
Returns a string that represents this layer type.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Qgis::SymbolType symbolType() const
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol...
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
bool placeOnEveryPart() const
Returns true if the placement applies for every part of multi-part feature geometries.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
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.