52#include <QAbstractButton>
53#include <QButtonGroup>
54#include <QColorDialog>
59#include <QStandardItemModel>
60#include <QSvgRenderer>
64#include <QInputDialog>
66#include <QRegularExpression>
72 return *lExpressionContext;
83 expContext << symbolScope;
105 QStringList highlights;
111 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" ) << QStringLiteral(
"symbol_frame" );
114 if ( expContext.
hasVariable( QStringLiteral(
"zoom_level" ) ) )
116 highlights << QStringLiteral(
"zoom_level" );
118 if ( expContext.
hasVariable( QStringLiteral(
"vector_tile_zoom" ) ) )
120 highlights << QStringLiteral(
"vector_tile_zoom" );
131 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
134 unitWidget->setMapCanvas( mContext.
mapCanvas() );
152void QgsSymbolLayerWidget::createAuxiliaryField()
173 if ( dlg.exec() == QDialog::Accepted )
174 def = dlg.propertyDefinition();
184 property.setActive(
true );
206 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
207 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
211 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
213 connect( mCheckAlignDash, &QCheckBox::toggled,
this, [ = ]
215 mCheckDashCorners->setEnabled( mCheckAlignDash->isChecked() );
216 if ( !mCheckAlignDash->isChecked() )
217 mCheckDashCorners->setChecked(
false );
225 connect( mCheckDashCorners, &QCheckBox::toggled,
this, [ = ]
247 btnChangeColor->setAllowOpacity(
true );
248 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
249 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
251 mColorDDBtn->registerLinkedWidget( btnChangeColor );
256 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
265 spinOffset->setClearValue( 0.0 );
266 spinPatternOffset->setClearValue( 0.0 );
268 mTrimStartDistanceSpin->setClearValue( 0.0 );
269 mTrimDistanceEndSpin->setClearValue( 0.0 );
275 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
277 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
279 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
280 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
281 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
282 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
283 connect( spinPatternOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::patternOffsetChanged );
285 connect( mTrimStartDistanceSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
302 connect( mTrimDistanceEndSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
328void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
330 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
332 mAssistantPreviewSymbol->deleteSymbolLayer( i );
334 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
337 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
343 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
350 mPenWidthUnitWidget->blockSignals(
true );
353 mPenWidthUnitWidget->blockSignals(
false );
354 mOffsetUnitWidget->blockSignals(
true );
357 mOffsetUnitWidget->blockSignals(
false );
358 mDashPatternUnitWidget->blockSignals(
true );
361 mDashPatternUnitWidget->blockSignals(
false );
371 spinWidth->blockSignals(
true );
373 spinWidth->blockSignals(
false );
374 btnChangeColor->blockSignals(
true );
376 btnChangeColor->blockSignals(
false );
377 spinOffset->blockSignals(
true );
379 spinOffset->blockSignals(
false );
380 cboPenStyle->blockSignals(
true );
381 cboJoinStyle->blockSignals(
true );
382 cboCapStyle->blockSignals(
true );
386 cboPenStyle->blockSignals(
false );
387 cboJoinStyle->blockSignals(
false );
388 cboCapStyle->blockSignals(
false );
395 mChangePatternButton->setEnabled( useCustomDashPattern );
396 label_3->setEnabled( !useCustomDashPattern );
397 cboPenStyle->setEnabled( !useCustomDashPattern );
398 mCustomCheckBox->blockSignals(
true );
399 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
400 mCustomCheckBox->blockSignals(
false );
403 const QSize size = mChangePatternButton->minimumSizeHint();
405 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
409 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
430 updateAssistantSymbol();
447 mDrawInsideCheckBox->hide();
448 mRingFilterComboBox->hide();
458void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
465void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
471void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
480void QgsSimpleLineSymbolLayerWidget::offsetChanged()
487void QgsSimpleLineSymbolLayerWidget::patternOffsetChanged()
494void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
496 const bool checked = ( state == Qt::Checked );
497 mChangePatternButton->setEnabled( checked );
498 label_3->setEnabled( !checked );
499 cboPenStyle->setEnabled( !checked );
505void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
512 widget->
setUnit( mDashPatternUnitWidget->unit() );
524 d.setUnit( mDashPatternUnitWidget->unit() );
525 if ( d.exec() == QDialog::Accepted )
533void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
544void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
554void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
565void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
567 const bool checked = ( state == Qt::Checked );
572void QgsSimpleLineSymbolLayerWidget::patternOffsetUnitChanged()
589 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
594 const QColor color = qApp->palette().color( QPalette::WindowText );
595 layerCopy->setColor( color );
597 layerCopy->setOffset( 0 );
598 layerCopy->setUseCustomDashPattern(
true );
600 QSize currentIconSize;
603 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
605 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
608 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
614 const std::unique_ptr< QgsLineSymbol > previewSymbol = std::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
616 mChangePatternButton->setIconSize( currentIconSize );
617 mChangePatternButton->setIcon( icon );
621 const int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
622 const int height =
static_cast< int >( width / 1.61803398875 );
626 QBuffer buffer( &data );
627 pm.save( &buffer,
"PNG", 100 );
628 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
633 QgsSymbolLayerWidget::resizeEvent( event );
651 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
652 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
653 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
654 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
662 btnChangeColorFill->setAllowOpacity(
true );
663 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
664 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
665 btnChangeColorFill->setShowNoColor(
true );
666 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
667 btnChangeColorStroke->setAllowOpacity(
true );
668 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
669 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
670 btnChangeColorStroke->setShowNoColor(
true );
671 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
673 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
674 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
676 spinOffsetX->setClearValue( 0.0 );
677 spinOffsetY->setClearValue( 0.0 );
678 spinAngle->setClearValue( 0.0 );
684 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
686 int size = lstNames->iconSize().width();
688 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
690 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
691 lstNames->setIconSize( QSize( size, size ) );
693 const double markerSize = size * 0.8;
699 lyr->
setColor( QColor( 200, 200, 200 ) );
702 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
703 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
708 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
710 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
713 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
714 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged );
715 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
716 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
717 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
718 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
726 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
734 for (
int i = 0; i < lstNames->count(); ++i )
736 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
738 lstNames->setCurrentRow( i );
742 btnChangeColorStroke->blockSignals(
true );
744 btnChangeColorStroke->blockSignals(
false );
745 btnChangeColorFill->blockSignals(
true );
748 btnChangeColorFill->blockSignals(
false );
749 spinSize->blockSignals(
true );
751 spinSize->blockSignals(
false );
752 spinAngle->blockSignals(
true );
754 spinAngle->blockSignals(
false );
755 mStrokeStyleComboBox->blockSignals(
true );
757 mStrokeStyleComboBox->blockSignals(
false );
758 mStrokeWidthSpinBox->blockSignals(
true );
760 mStrokeWidthSpinBox->blockSignals(
false );
761 cboJoinStyle->blockSignals(
true );
763 cboJoinStyle->blockSignals(
false );
764 cboCapStyle->blockSignals(
true );
766 cboCapStyle->blockSignals(
false );
769 spinOffsetX->blockSignals(
true );
771 spinOffsetX->blockSignals(
false );
772 spinOffsetY->blockSignals(
true );
774 spinOffsetY->blockSignals(
false );
776 mSizeUnitWidget->blockSignals(
true );
779 mSizeUnitWidget->blockSignals(
false );
780 mOffsetUnitWidget->blockSignals(
true );
783 mOffsetUnitWidget->blockSignals(
false );
784 mStrokeWidthUnitWidget->blockSignals(
true );
787 mStrokeWidthUnitWidget->blockSignals(
false );
790 mHorizontalAnchorComboBox->blockSignals(
true );
791 mVerticalAnchorComboBox->blockSignals(
true );
794 mHorizontalAnchorComboBox->blockSignals(
false );
795 mVerticalAnchorComboBox->blockSignals(
false );
810 updateAssistantSymbol();
818void QgsSimpleMarkerSymbolLayerWidget::setShape()
837void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
843void QgsSimpleMarkerSymbolLayerWidget::penCapStyleChanged()
849void QgsSimpleMarkerSymbolLayerWidget::setSize()
855void QgsSimpleMarkerSymbolLayerWidget::setAngle()
861void QgsSimpleMarkerSymbolLayerWidget::setOffset()
863 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
867void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
878void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
887void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
897void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
907void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
917void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
926void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
935void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
937 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
939 mAssistantPreviewSymbol->deleteSymbolLayer( i );
941 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
944 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
963 btnChangeColor->setAllowOpacity(
true );
964 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
965 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
966 btnChangeColor->setShowNoColor(
true );
967 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
968 btnChangeStrokeColor->setAllowOpacity(
true );
969 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
970 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
971 btnChangeStrokeColor->setShowNoColor(
true );
972 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
974 spinOffsetX->setClearValue( 0.0 );
975 spinOffsetY->setClearValue( 0.0 );
978 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
980 connect( spinStrokeWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
981 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
982 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
983 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
984 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
986 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
987 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
992 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
999 btnChangeColor->blockSignals(
true );
1001 btnChangeColor->blockSignals(
false );
1002 cboFillStyle->blockSignals(
true );
1004 cboFillStyle->blockSignals(
false );
1005 btnChangeStrokeColor->blockSignals(
true );
1007 btnChangeStrokeColor->blockSignals(
false );
1008 cboStrokeStyle->blockSignals(
true );
1010 cboStrokeStyle->blockSignals(
false );
1011 spinStrokeWidth->blockSignals(
true );
1013 spinStrokeWidth->blockSignals(
false );
1014 cboJoinStyle->blockSignals(
true );
1016 cboJoinStyle->blockSignals(
false );
1017 spinOffsetX->blockSignals(
true );
1019 spinOffsetX->blockSignals(
false );
1020 spinOffsetY->blockSignals(
true );
1022 spinOffsetY->blockSignals(
false );
1024 mStrokeWidthUnitWidget->blockSignals(
true );
1027 mStrokeWidthUnitWidget->blockSignals(
false );
1028 mOffsetUnitWidget->blockSignals(
true );
1031 mOffsetUnitWidget->blockSignals(
false );
1059void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
1065void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
1071void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
1078void QgsSimpleFillSymbolLayerWidget::offsetChanged()
1080 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1084void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
1094void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1114 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1115 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1121 spinOffsetX->setClearValue( 0.0 );
1122 spinOffsetY->setClearValue( 0.0 );
1123 spinAngle->setClearValue( 0.0 );
1129 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
1131 int size = lstNames->iconSize().width();
1132 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
1133 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
1134 lstNames->setIconSize( QSize( size, size ) );
1136 const double markerSize = size * 0.8;
1142 lyr->
setColor( QColor( 200, 200, 200 ) );
1145 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1146 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
1151 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1153 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1154 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1155 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1156 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1157 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1165 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1173 for (
int i = 0; i < lstNames->count(); ++i )
1175 if (
static_cast< Qgis::MarkerShape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1177 lstNames->setCurrentRow( i );
1186 mSizeUnitWidget->blockSignals(
true );
1189 mSizeUnitWidget->blockSignals(
false );
1190 mOffsetUnitWidget->blockSignals(
true );
1193 mOffsetUnitWidget->blockSignals(
false );
1206 updateAssistantSymbol();
1214void QgsFilledMarkerSymbolLayerWidget::setShape()
1220void QgsFilledMarkerSymbolLayerWidget::setSize()
1226void QgsFilledMarkerSymbolLayerWidget::setAngle()
1232void QgsFilledMarkerSymbolLayerWidget::setOffset()
1234 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1238void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1248void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1258void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1267void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1276void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1278 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1280 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1282 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1285 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1298 connect( mSpinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1302 btnColorRamp->setShowGradientOnly(
true );
1304 btnChangeColor->setAllowOpacity(
true );
1305 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1306 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1307 btnChangeColor->setShowNoColor(
true );
1308 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1309 btnChangeColor2->setAllowOpacity(
true );
1310 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1311 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1312 btnChangeColor2->setShowNoColor(
true );
1313 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1315 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1316 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1318 spinOffsetX->setClearValue( 0.0 );
1319 spinOffsetY->setClearValue( 0.0 );
1320 mSpinAngle->setClearValue( 0.0 );
1328 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1329 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1330 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1331 connect( spinRefPoint1X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1332 connect( spinRefPoint1Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1333 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1334 connect( spinRefPoint2X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1335 connect( spinRefPoint2Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1336 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1341 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1348 btnChangeColor->blockSignals(
true );
1350 btnChangeColor->blockSignals(
false );
1351 btnChangeColor2->blockSignals(
true );
1353 btnChangeColor2->blockSignals(
false );
1357 radioTwoColor->setChecked(
true );
1358 btnColorRamp->setEnabled(
false );
1362 radioColorRamp->setChecked(
true );
1363 btnChangeColor->setEnabled(
false );
1364 btnChangeColor2->setEnabled(
false );
1370 btnColorRamp->blockSignals(
true );
1372 btnColorRamp->blockSignals(
false );
1375 cboGradientType->blockSignals(
true );
1379 cboGradientType->setCurrentIndex( 0 );
1382 cboGradientType->setCurrentIndex( 1 );
1385 cboGradientType->setCurrentIndex( 2 );
1388 cboGradientType->blockSignals(
false );
1390 cboCoordinateMode->blockSignals(
true );
1394 cboCoordinateMode->setCurrentIndex( 1 );
1395 checkRefPoint1Centroid->setEnabled(
false );
1396 checkRefPoint2Centroid->setEnabled(
false );
1400 cboCoordinateMode->setCurrentIndex( 0 );
1403 cboCoordinateMode->blockSignals(
false );
1405 cboGradientSpread->blockSignals(
true );
1409 cboGradientSpread->setCurrentIndex( 0 );
1412 cboGradientSpread->setCurrentIndex( 1 );
1415 cboGradientSpread->setCurrentIndex( 2 );
1418 cboGradientSpread->blockSignals(
false );
1420 spinRefPoint1X->blockSignals(
true );
1422 spinRefPoint1X->blockSignals(
false );
1423 spinRefPoint1Y->blockSignals(
true );
1425 spinRefPoint1Y->blockSignals(
false );
1426 checkRefPoint1Centroid->blockSignals(
true );
1430 spinRefPoint1X->setEnabled(
false );
1431 spinRefPoint1Y->setEnabled(
false );
1433 checkRefPoint1Centroid->blockSignals(
false );
1434 spinRefPoint2X->blockSignals(
true );
1436 spinRefPoint2X->blockSignals(
false );
1437 spinRefPoint2Y->blockSignals(
true );
1439 spinRefPoint2Y->blockSignals(
false );
1440 checkRefPoint2Centroid->blockSignals(
true );
1444 spinRefPoint2X->setEnabled(
false );
1445 spinRefPoint2Y->setEnabled(
false );
1447 checkRefPoint2Centroid->blockSignals(
false );
1449 spinOffsetX->blockSignals(
true );
1451 spinOffsetX->blockSignals(
false );
1452 spinOffsetY->blockSignals(
true );
1454 spinOffsetY->blockSignals(
false );
1455 mSpinAngle->blockSignals(
true );
1457 mSpinAngle->blockSignals(
false );
1459 mOffsetUnitWidget->blockSignals(
true );
1462 mOffsetUnitWidget->blockSignals(
false );
1496void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1498 if ( radioTwoColor->isChecked() )
1511 if ( btnColorRamp->isNull() )
1525 spinRefPoint1X->setValue( 0.5 );
1526 spinRefPoint1Y->setValue( 0 );
1527 spinRefPoint2X->setValue( 0.5 );
1528 spinRefPoint2Y->setValue( 1 );
1533 spinRefPoint1X->setValue( 0 );
1534 spinRefPoint1Y->setValue( 0 );
1535 spinRefPoint2X->setValue( 1 );
1536 spinRefPoint2Y->setValue( 1 );
1540 spinRefPoint1X->setValue( 0.5 );
1541 spinRefPoint1Y->setValue( 0.5 );
1542 spinRefPoint2X->setValue( 1 );
1543 spinRefPoint2Y->setValue( 1 );
1558 checkRefPoint1Centroid->setEnabled(
true );
1559 checkRefPoint2Centroid->setEnabled(
true );
1565 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1566 checkRefPoint1Centroid->setEnabled(
false );
1567 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1568 checkRefPoint2Centroid->setEnabled(
false );
1593void QgsGradientFillSymbolLayerWidget::offsetChanged()
1595 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1599void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1608void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1614void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1632 connect( mSpinBlurRadius, qOverload< int >( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1633 connect( mSpinMaxDistance, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1635 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1637 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1643 QButtonGroup *group1 =
new QButtonGroup(
this );
1644 group1->addButton( radioColorRamp );
1645 group1->addButton( radioTwoColor );
1646 QButtonGroup *group2 =
new QButtonGroup(
this );
1647 group2->addButton( mRadioUseMaxDistance );
1648 group2->addButton( mRadioUseWholeShape );
1649 btnChangeColor->setAllowOpacity(
true );
1650 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1651 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1652 btnChangeColor->setShowNoColor(
true );
1653 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1654 btnChangeColor2->setAllowOpacity(
true );
1655 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1656 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1657 btnChangeColor2->setShowNoColor(
true );
1658 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1660 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1661 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1663 spinOffsetX->setClearValue( 0.0 );
1664 spinOffsetY->setClearValue( 0.0 );
1665 mSpinMaxDistance->setClearValue( 5.0 );
1667 btnColorRamp->setShowGradientOnly(
true );
1673 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1674 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1675 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1677 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1678 connect( mSpinBlurRadius,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1683 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1690 btnChangeColor->blockSignals(
true );
1692 btnChangeColor->blockSignals(
false );
1693 btnChangeColor2->blockSignals(
true );
1695 btnChangeColor2->blockSignals(
false );
1699 radioTwoColor->setChecked(
true );
1700 btnColorRamp->setEnabled(
false );
1704 radioColorRamp->setChecked(
true );
1705 btnChangeColor->setEnabled(
false );
1706 btnChangeColor2->setEnabled(
false );
1709 mSpinBlurRadius->blockSignals(
true );
1710 mBlurSlider->blockSignals(
true );
1713 mSpinBlurRadius->blockSignals(
false );
1714 mBlurSlider->blockSignals(
false );
1716 mSpinMaxDistance->blockSignals(
true );
1718 mSpinMaxDistance->blockSignals(
false );
1720 mRadioUseWholeShape->blockSignals(
true );
1721 mRadioUseMaxDistance->blockSignals(
true );
1724 mRadioUseWholeShape->setChecked(
true );
1725 mSpinMaxDistance->setEnabled(
false );
1726 mDistanceUnitWidget->setEnabled(
false );
1730 mRadioUseMaxDistance->setChecked(
true );
1731 mSpinMaxDistance->setEnabled(
true );
1732 mDistanceUnitWidget->setEnabled(
true );
1734 mRadioUseWholeShape->blockSignals(
false );
1735 mRadioUseMaxDistance->blockSignals(
false );
1737 mDistanceUnitWidget->blockSignals(
true );
1740 mDistanceUnitWidget->blockSignals(
false );
1742 mIgnoreRingsCheckBox->blockSignals(
true );
1743 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1744 mIgnoreRingsCheckBox->blockSignals(
false );
1749 btnColorRamp->blockSignals(
true );
1751 btnColorRamp->blockSignals(
false );
1754 spinOffsetX->blockSignals(
true );
1756 spinOffsetX->blockSignals(
false );
1757 spinOffsetY->blockSignals(
true );
1759 spinOffsetY->blockSignals(
false );
1760 mOffsetUnitWidget->blockSignals(
true );
1763 mOffsetUnitWidget->blockSignals(
false );
1797void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1804 if ( radioTwoColor->isChecked() )
1815void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1824void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1833void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1843void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1848 mDistanceUnitWidget->setEnabled( !value );
1853void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1863void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1867 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1872void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1883void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1885 const bool checked = ( state == Qt::Checked );
1914 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1923 spinOffset->setClearValue( 0.0 );
1924 mSpinOffsetAlongLine->setClearValue( 0.0 );
1925 mSpinAverageAngleLength->setClearValue( 4.0 );
1929 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1930 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1931 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1932 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1933 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1934 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1935 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1936 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1937 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1938 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1939 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
1951 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1958 spinInterval->blockSignals(
true );
1960 spinInterval->blockSignals(
false );
1961 mSpinOffsetAlongLine->blockSignals(
true );
1963 mSpinOffsetAlongLine->blockSignals(
false );
1964 chkRotateMarker->blockSignals(
true );
1966 chkRotateMarker->blockSignals(
false );
1967 spinOffset->blockSignals(
true );
1969 spinOffset->blockSignals(
false );
1984 mIntervalUnitWidget->blockSignals(
true );
1987 mIntervalUnitWidget->blockSignals(
false );
1988 mOffsetUnitWidget->blockSignals(
true );
1991 mOffsetUnitWidget->blockSignals(
false );
1992 mOffsetAlongLineUnitWidget->blockSignals(
true );
1995 mOffsetAlongLineUnitWidget->blockSignals(
false );
2026 mRingFilterComboBox->hide();
2027 mRingsLabel->hide();
2048void QgsMarkerLineSymbolLayerWidget::setRotate()
2050 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2051 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2057void QgsMarkerLineSymbolLayerWidget::setOffset()
2063void QgsMarkerLineSymbolLayerWidget::setPlacement()
2065 const bool interval = mCheckInterval->isChecked();
2066 spinInterval->setEnabled( interval );
2067 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2068 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2069 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2070 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2071 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2073 Qgis::MarkerLinePlacements placements;
2074 if ( mCheckInterval->isChecked() )
2076 if ( mCheckVertex->isChecked() )
2078 if ( mCheckVertexLast->isChecked() )
2080 if ( mCheckVertexFirst->isChecked() )
2082 if ( mCheckCurvePoint->isChecked() )
2084 if ( mCheckSegmentCentralPoint->isChecked() )
2086 if ( mCheckCentralPoint->isChecked() )
2093void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2103void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2113void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2123void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
2133void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2170 connect( mRingFilterComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2179 spinOffset->setClearValue( 0.0 );
2180 mSpinOffsetAlongLine->setClearValue( 0.0 );
2181 mHashRotationSpinBox->setClearValue( 0 );
2182 mSpinAverageAngleLength->setClearValue( 4.0 );
2184 connect( spinInterval,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2185 connect( mSpinOffsetAlongLine,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2186 connect( mSpinHashLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2187 connect( mHashRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2188 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2189 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2190 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2192 connect( mCheckInterval, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2193 connect( mCheckVertex, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2194 connect( mCheckVertexLast, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2195 connect( mCheckVertexFirst, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2196 connect( mCheckCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2197 connect( mCheckCurvePoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2198 connect( mCheckSegmentCentralPoint, &QCheckBox::toggled,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2200 connect( mCheckPlaceOnEveryPart, &QCheckBox::toggled,
this, [ = ]
2212 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2219 spinInterval->blockSignals(
true );
2220 spinInterval->setValue( mLayer->
interval() );
2221 spinInterval->blockSignals(
false );
2222 mSpinOffsetAlongLine->blockSignals(
true );
2224 mSpinOffsetAlongLine->blockSignals(
false );
2227 chkRotateMarker->blockSignals(
true );
2229 chkRotateMarker->blockSignals(
false );
2230 spinOffset->blockSignals(
true );
2231 spinOffset->setValue( mLayer->
offset() );
2232 spinOffset->blockSignals(
false );
2247 mIntervalUnitWidget->blockSignals(
true );
2248 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2250 mIntervalUnitWidget->blockSignals(
false );
2251 mOffsetUnitWidget->blockSignals(
true );
2252 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2254 mOffsetUnitWidget->blockSignals(
false );
2255 mOffsetAlongLineUnitWidget->blockSignals(
true );
2258 mOffsetAlongLineUnitWidget->blockSignals(
false );
2265 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2292 mRingFilterComboBox->hide();
2293 mRingsLabel->hide();
2302void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2308void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2314void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2320void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2326void QgsHashedLineSymbolLayerWidget::setRotate()
2328 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2329 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2335void QgsHashedLineSymbolLayerWidget::setOffset()
2337 mLayer->
setOffset( spinOffset->value() );
2341void QgsHashedLineSymbolLayerWidget::setPlacement()
2343 const bool interval = mCheckInterval->isChecked();
2344 spinInterval->setEnabled( interval );
2345 mSpinOffsetAlongLine->setEnabled( mCheckInterval->isChecked() || mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2346 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2347 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( mCheckInterval->isChecked() || mCheckCentralPoint->isChecked() ) );
2348 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2349 mCheckPlaceOnEveryPart->setEnabled( mCheckVertexLast->isChecked() || mCheckVertexFirst->isChecked() );
2351 Qgis::MarkerLinePlacements placements;
2352 if ( mCheckInterval->isChecked() )
2354 if ( mCheckVertex->isChecked() )
2356 if ( mCheckVertexLast->isChecked() )
2358 if ( mCheckVertexFirst->isChecked() )
2360 if ( mCheckCurvePoint->isChecked() )
2362 if ( mCheckSegmentCentralPoint->isChecked() )
2364 if ( mCheckCentralPoint->isChecked() )
2371void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2381void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2391void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2401void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2411void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2421void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2440 mSvgSelectorWidget->setAllowParameters(
true );
2441 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2442 mSvgSelectorWidget->sourceLineEdit()->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2443 mSvgSelectorWidget->initParametersModel(
this, vl );
2447 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2448 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2452 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2453 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2460 mChangeColorButton->setAllowOpacity(
true );
2461 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2462 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2463 mChangeStrokeColorButton->setAllowOpacity(
true );
2464 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2465 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2467 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2468 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2470 spinOffsetX->setClearValue( 0.0 );
2471 spinOffsetY->setClearValue( 0.0 );
2472 spinAngle->setClearValue( 0.0 );
2474 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2475 connect( spinHeight,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2477 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2478 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2479 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2490 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2491 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2498#include <QAbstractListModel>
2499#include <QPixmapCache>
2513 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2514 QColor defaultFill, defaultStroke;
2515 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2516 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2518 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2519 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2520 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2521 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2522 mChangeColorButton->setEnabled( hasFillParam );
2523 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2524 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2525 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2526 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2531 const double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2532 if ( hasDefaultFillColor && !skipDefaultColors )
2536 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2537 mChangeColorButton->setColor( fill );
2539 if ( hasStrokeParam )
2542 const double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2543 if ( hasDefaultStrokeColor && !skipDefaultColors )
2545 stroke = defaultStroke;
2547 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2548 mChangeStrokeColorButton->setColor( stroke );
2551 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( layer->
path() );
2553 mStrokeWidthSpinBox->blockSignals(
true );
2554 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2555 mStrokeWidthSpinBox->blockSignals(
false );
2558 spinHeight->blockSignals(
true );
2559 if ( preservedAspectRatio )
2568 spinHeight->blockSignals(
false );
2569 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2572void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2574 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2576 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2578 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2581 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2592 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2599 mSvgSelectorWidget->setSvgPath(
mLayer->
path() );
2602 spinWidth->blockSignals(
true );
2604 spinWidth->blockSignals(
false );
2605 spinAngle->blockSignals(
true );
2607 spinAngle->blockSignals(
false );
2610 spinOffsetX->blockSignals(
true );
2612 spinOffsetX->blockSignals(
false );
2613 spinOffsetY->blockSignals(
true );
2615 spinOffsetY->blockSignals(
false );
2617 mSizeUnitWidget->blockSignals(
true );
2620 mSizeUnitWidget->blockSignals(
false );
2621 mStrokeWidthUnitWidget->blockSignals(
true );
2624 mStrokeWidthUnitWidget->blockSignals(
false );
2625 mOffsetUnitWidget->blockSignals(
true );
2628 mOffsetUnitWidget->blockSignals(
false );
2631 mHorizontalAnchorComboBox->blockSignals(
true );
2632 mVerticalAnchorComboBox->blockSignals(
true );
2635 mHorizontalAnchorComboBox->blockSignals(
false );
2636 mVerticalAnchorComboBox->blockSignals(
false );
2652 updateAssistantSymbol();
2669 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2678 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2684void QgsSvgMarkerSymbolLayerWidget::setWidth()
2687 double fixedAspectRatio = 0.0;
2688 spinHeight->blockSignals(
true );
2689 if ( defaultAspectRatio <= 0.0 )
2691 spinHeight->setValue( spinWidth->value() );
2693 else if ( mLockAspectRatio->locked() )
2695 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2699 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2701 spinHeight->blockSignals(
false );
2707void QgsSvgMarkerSymbolLayerWidget::setHeight()
2710 double fixedAspectRatio = 0.0;
2711 spinWidth->blockSignals(
true );
2712 if ( defaultAspectRatio <= 0.0 )
2714 spinWidth->setValue( spinHeight->value() );
2716 else if ( mLockAspectRatio->locked() )
2718 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2722 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2724 spinWidth->blockSignals(
false );
2730void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2734 if ( defaultAspectRatio <= 0.0 )
2750void QgsSvgMarkerSymbolLayerWidget::setAngle()
2756void QgsSvgMarkerSymbolLayerWidget::setOffset()
2758 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2762void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2769void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2780void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2791void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2800void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2810void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2820void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2830void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2839void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2855 mSvgSelectorWidget->setAllowParameters(
true );
2856 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2858 connect( mTextureWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2860 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2862 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2863 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2871 mRotationSpinBox->setClearValue( 0.0 );
2873 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2874 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2875 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2876 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2878 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2879 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2892 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2901 mTextureWidthSpinBox->blockSignals(
true );
2902 mTextureWidthSpinBox->setValue( width );
2903 mTextureWidthSpinBox->blockSignals(
false );
2905 mRotationSpinBox->blockSignals(
true );
2907 mRotationSpinBox->blockSignals(
false );
2908 mTextureWidthUnitWidget->blockSignals(
true );
2911 mTextureWidthUnitWidget->blockSignals(
false );
2912 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2915 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2916 mChangeColorButton->blockSignals(
true );
2918 mChangeColorButton->blockSignals(
false );
2919 mChangeStrokeColorButton->blockSignals(
true );
2921 mChangeStrokeColorButton->blockSignals(
false );
2922 mStrokeWidthSpinBox->blockSignals(
true );
2924 mStrokeWidthSpinBox->blockSignals(
false );
2948void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2957void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2969void QgsSVGFillSymbolLayerWidget::setFile(
const QString &name )
2972 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2978void QgsSVGFillSymbolLayerWidget::setSvgParameters(
const QMap<QString, QgsProperty> ¶meters )
2981 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2988void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
3000 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
3001 QColor defaultFill, defaultStroke;
3002 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
3003 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
3005 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
3006 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
3007 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
3008 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
3011 QColor fill = mChangeColorButton->color();
3012 const double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
3013 if ( hasDefaultFillColor )
3017 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
3018 mChangeColorButton->setColor( fill );
3020 mChangeColorButton->setEnabled( hasFillParam );
3021 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
3024 QColor stroke = mChangeStrokeColorButton->color();
3025 const double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
3026 if ( hasDefaultStrokeColor )
3028 stroke = defaultStroke;
3030 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
3031 mChangeStrokeColorButton->setColor( stroke );
3033 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
3034 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
3035 if ( hasDefaultStrokeWidth && resetValues )
3037 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
3039 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
3042void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
3053void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
3064void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3073void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
3083void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
3099 connect( mAngleSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
3100 connect( mDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
3101 connect( mOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
3108 mOffsetSpinBox->setClearValue( 0 );
3109 mAngleSpinBox->setClearValue( 0 );
3113 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3125 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3138 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3152 mDistanceUnitWidget->blockSignals(
true );
3155 mDistanceUnitWidget->blockSignals(
false );
3156 mOffsetUnitWidget->blockSignals(
true );
3159 mOffsetUnitWidget->blockSignals(
false );
3177void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3186void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3195void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3204void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3214void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3230 connect( mHorizontalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3231 connect( mVerticalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3232 connect( mHorizontalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3233 connect( mVerticalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3234 connect( mHorizontalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3235 connect( mVerticalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3236 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3237 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3238 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3239 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3240 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3241 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3259 connect( mClipModeComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3270 connect( mCoordinateReferenceComboBox, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
3279 mSeedSpinBox->setShowClearButton(
true );
3280 mSeedSpinBox->setClearValue( 0 );
3281 mRandomXSpinBox->setClearValue( 0 );
3282 mRandomYSpinBox->setClearValue( 0 );
3288 connect( mRandomXSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3296 connect( mRandomYSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3322 connect( mSeedSpinBox, qOverload< int > ( &QSpinBox::valueChanged ),
this, [ = ](
int v )
3331 mAngleSpinBox->setShowClearButton(
true );
3332 mAngleSpinBox->setClearValue( 0 );
3333 connect( mAngleSpinBox, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double d )
3345 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3359 mHorizontalDistanceUnitWidget->blockSignals(
true );
3362 mHorizontalDistanceUnitWidget->blockSignals(
false );
3363 mVerticalDistanceUnitWidget->blockSignals(
true );
3366 mVerticalDistanceUnitWidget->blockSignals(
false );
3367 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3370 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3371 mVerticalDisplacementUnitWidget->blockSignals(
true );
3374 mVerticalDisplacementUnitWidget->blockSignals(
false );
3375 mHorizontalOffsetUnitWidget->blockSignals(
true );
3378 mHorizontalOffsetUnitWidget->blockSignals(
false );
3379 mVerticalOffsetUnitWidget->blockSignals(
true );
3382 mVerticalOffsetUnitWidget->blockSignals(
false );
3414void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3423void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3432void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3441void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3450void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3459void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3468void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3478void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3488void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3498void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3508void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3518void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3539 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3540 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3541 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3551 scrollArea->setVerticalOnly(
true );
3553 btnColor->setAllowOpacity(
true );
3554 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3555 btnColor->setContext( QStringLiteral(
"symbology" ) );
3556 btnStrokeColor->setAllowOpacity(
true );
3557 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3558 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3560 mColorDDBtn->registerLinkedWidget( btnColor );
3561 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3563 spinOffsetX->setClearValue( 0.0 );
3564 spinOffsetY->setClearValue( 0.0 );
3565 spinAngle->setClearValue( 0.0 );
3571 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3574 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3576 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3579 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3581 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3582 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3593 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3602 mFontStyleComboBox->blockSignals(
true );
3603 populateFontStyleComboBox();
3604 mFontStyleComboBox->blockSignals(
false );
3622 mCharPreview->setFont( mRefFont );
3628 mSizeUnitWidget->blockSignals(
true );
3631 mSizeUnitWidget->blockSignals(
false );
3633 mStrokeWidthUnitWidget->blockSignals(
true );
3636 mStrokeWidthUnitWidget->blockSignals(
false );
3638 mOffsetUnitWidget->blockSignals(
true );
3641 mOffsetUnitWidget->blockSignals(
false );
3662 updateAssistantSymbol();
3675 mRefFont.setFamily( font.family() );
3677 mCharPreview->setFont( mRefFont );
3678 populateFontStyleComboBox();
3683void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3690 mCharPreview->setFont( mRefFont );
3722 mCharPreview->setText( text );
3724 if ( text.isEmpty() )
3728 QString character = text;
3729 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3732 const unsigned int value = text.toUInt( &ok, 0 );
3735 character = QChar( value );
3736 mCharPreview->setText( character );
3757 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3759 mCharLineEdit->insert( chr );
3765 mCharPreview->setText( chr );
3769void QgsFontMarkerSymbolLayerWidget::setOffset()
3771 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3775void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3781void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3791void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3801void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3811void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3813 mFontStyleComboBox->clear();
3814 const QStringList styles = mFontDB.styles( mRefFont.family() );
3815 const auto constStyles = styles;
3816 for (
const QString &style : constStyles )
3818 mFontStyleComboBox->addItem( style );
3821 QString targetStyle = mFontDB.styleString( mRefFont );
3822 if ( !styles.contains( targetStyle ) )
3824 const QFont f = QFont( mRefFont.family() );
3825 targetStyle = QFontInfo( f ).styleName();
3826 mRefFont.setStyleName( targetStyle );
3829 const int stylIndx = mFontStyleComboBox->findText( targetStyle );
3830 if ( stylIndx > -1 )
3835 mFontStyleComboBox->setCurrentIndex( curIndx );
3838void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3841 setFontStyle( mFontStyleComboBox->currentText() );
3844void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3853void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3862void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3871void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3873 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3875 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3877 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3880 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3892 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3893 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3894 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3895 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3900 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3918void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3924void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3930void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3936void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3951 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3955 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3957 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3958 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3966 mSpinOffsetX->setClearValue( 0.0 );
3967 mSpinOffsetY->setClearValue( 0.0 );
3968 mRotationSpinBox->setClearValue( 0.0 );
3970 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3971 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3974 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3975 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3985 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3996 mHeightSpinBox->blockSignals(
true );
3997 if ( preservedAspectRatio )
4006 mHeightSpinBox->blockSignals(
false );
4007 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4015 mSizeUnitWidget->blockSignals(
true );
4018 mSizeUnitWidget->blockSignals(
false );
4019 mOffsetUnitWidget->blockSignals(
true );
4022 mOffsetUnitWidget->blockSignals(
false );
4037 updatePreviewImage();
4051void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4054 updatePreviewImage();
4058void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
4060 bool fitsInCache =
false;
4062 if ( image.isNull() )
4064 mLabelImagePreview->setPixmap( QPixmap() );
4068 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4069 previewImage.fill( Qt::transparent );
4070 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4072 p.begin( &previewImage );
4074 uchar pixDataRGB[] = { 150, 150, 150, 150,
4079 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4080 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4081 QBrush checkerBrush;
4082 checkerBrush.setTexture( pix );
4083 p.fillRect( imageRect, checkerBrush );
4090 p.drawImage( imageRect.left(), imageRect.top(), image );
4092 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4095void QgsRasterMarkerSymbolLayerWidget::setWidth()
4098 double fixedAspectRatio = 0.0;
4099 mHeightSpinBox->blockSignals(
true );
4100 if ( defaultAspectRatio <= 0.0 )
4102 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4104 else if ( mLockAspectRatio->locked() )
4106 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4110 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4112 mHeightSpinBox->blockSignals(
false );
4118void QgsRasterMarkerSymbolLayerWidget::setHeight()
4121 double fixedAspectRatio = 0.0;
4122 mWidthSpinBox->blockSignals(
true );
4123 if ( defaultAspectRatio <= 0.0 )
4125 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4127 else if ( mLockAspectRatio->locked() )
4129 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4133 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4135 mWidthSpinBox->blockSignals(
false );
4141void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4144 if ( defaultAspectRatio <= 0.0 )
4159void QgsRasterMarkerSymbolLayerWidget::setAngle()
4165void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
4169 updatePreviewImage();
4172void QgsRasterMarkerSymbolLayerWidget::setOffset()
4174 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4178void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4188void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4198void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4207void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4226 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastAnimatedMarkerImageDir" ) );
4230 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setAngle );
4232 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setWidth );
4233 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setHeight );
4236 mFrameRateSpin->setClearValue( 10 );
4237 mFrameRateSpin->setShowClearButton(
true );
4238 connect( mFrameRateSpin, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double value )
4249 mSpinOffsetX->setClearValue( 0.0 );
4250 mSpinOffsetY->setClearValue( 0.0 );
4251 mRotationSpinBox->setClearValue( 0.0 );
4253 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4254 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::setOffset );
4257 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
4258 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
4268 if ( layer->
layerType() != QLatin1String(
"AnimatedMarker" ) )
4278 if ( firstFrameTime > 0 )
4280 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4284 mFrameRateSpin->setClearValue( 10 );
4289 mHeightSpinBox->blockSignals(
true );
4290 if ( preservedAspectRatio )
4299 mHeightSpinBox->blockSignals(
false );
4300 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
4310 mSizeUnitWidget->blockSignals(
true );
4313 mSizeUnitWidget->blockSignals(
false );
4314 mOffsetUnitWidget->blockSignals(
true );
4317 mOffsetUnitWidget->blockSignals(
false );
4332 updatePreviewImage();
4346void QgsAnimatedMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
4351 if ( firstFrameTime > 0 )
4353 mFrameRateSpin->setClearValue( 1000 / firstFrameTime );
4357 mFrameRateSpin->setClearValue( 10 );
4359 updatePreviewImage();
4363void QgsAnimatedMarkerSymbolLayerWidget::updatePreviewImage()
4365 if ( mPreviewMovie )
4367 mLabelImagePreview->setMovie(
nullptr );
4368 mPreviewMovie->deleteLater();
4369 mPreviewMovie =
nullptr;
4372 mPreviewMovie =
new QMovie(
mLayer->
path(), QByteArray(),
this );
4373 mPreviewMovie->setScaledSize( QSize( 150, 150 ) );
4374 mLabelImagePreview->setMovie( mPreviewMovie );
4375 mPreviewMovie->start();
4378void QgsAnimatedMarkerSymbolLayerWidget::setWidth()
4381 double fixedAspectRatio = 0.0;
4382 mHeightSpinBox->blockSignals(
true );
4383 if ( defaultAspectRatio <= 0.0 )
4385 mHeightSpinBox->setValue( mWidthSpinBox->value() );
4387 else if ( mLockAspectRatio->locked() )
4389 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
4393 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4395 mHeightSpinBox->blockSignals(
false );
4401void QgsAnimatedMarkerSymbolLayerWidget::setHeight()
4404 double fixedAspectRatio = 0.0;
4405 mWidthSpinBox->blockSignals(
true );
4406 if ( defaultAspectRatio <= 0.0 )
4408 mWidthSpinBox->setValue( mHeightSpinBox->value() );
4410 else if ( mLockAspectRatio->locked() )
4412 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
4416 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
4418 mWidthSpinBox->blockSignals(
false );
4424void QgsAnimatedMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
4427 if ( defaultAspectRatio <= 0.0 )
4442void QgsAnimatedMarkerSymbolLayerWidget::setAngle()
4448void QgsAnimatedMarkerSymbolLayerWidget::setOpacity(
double value )
4452 updatePreviewImage();
4455void QgsAnimatedMarkerSymbolLayerWidget::setOffset()
4457 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4461void QgsAnimatedMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
4471void QgsAnimatedMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
4481void QgsAnimatedMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
4490void QgsAnimatedMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4507 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4511 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
4513 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
4520 mSpinOffsetX->setClearValue( 0.0 );
4521 mSpinOffsetY->setClearValue( 0.0 );
4522 mRotationSpinBox->setClearValue( 0.0 );
4524 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4525 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4526 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4538 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4551 cboCoordinateMode->blockSignals(
true );
4555 cboCoordinateMode->setCurrentIndex( 1 );
4559 cboCoordinateMode->setCurrentIndex( 0 );
4562 cboCoordinateMode->blockSignals(
false );
4568 mOffsetUnitWidget->blockSignals(
true );
4571 mOffsetUnitWidget->blockSignals(
false );
4574 mWidthUnitWidget->blockSignals(
true );
4577 mWidthUnitWidget->blockSignals(
false );
4579 updatePreviewImage();
4593void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4596 updatePreviewImage();
4600void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4617void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4626 updatePreviewImage();
4629void QgsRasterFillSymbolLayerWidget::offsetChanged()
4631 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4635void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4646void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4655void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4666void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4676void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4678 bool fitsInCache =
false;
4680 if ( image.isNull() )
4682 mLabelImagePreview->setPixmap( QPixmap() );
4686 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4687 previewImage.fill( Qt::transparent );
4688 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4690 p.begin( &previewImage );
4692 uchar pixDataRGB[] = { 150, 150, 150, 150,
4697 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4698 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4699 QBrush checkerBrush;
4700 checkerBrush.setTexture( pix );
4701 p.fillRect( imageRect, checkerBrush );
4708 p.drawImage( imageRect.left(), imageRect.top(), image );
4710 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4724 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4741 connect( spinWidth, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ]
4761 spinOffset->setClearValue( 0.0 );
4762 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
4771 connect( cboCapStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4779 connect( cboJoinStyle, qOverload< int >( &QComboBox::currentIndexChanged ),
this, [ = ]
4794 updatePreviewImage();
4807 if ( layer->
layerType() != QLatin1String(
"RasterLine" ) )
4831 updatePreviewImage();
4846void QgsRasterLineSymbolLayerWidget::imageSourceChanged(
const QString &text )
4849 updatePreviewImage();
4853void QgsRasterLineSymbolLayerWidget::updatePreviewImage()
4855 bool fitsInCache =
false;
4857 if ( image.isNull() )
4859 mLabelImagePreview->setPixmap( QPixmap() );
4863 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4864 previewImage.fill( Qt::transparent );
4865 const QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4867 p.begin( &previewImage );
4869 uchar pixDataRGB[] = { 150, 150, 150, 150,
4874 const QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4875 const QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4876 QBrush checkerBrush;
4877 checkerBrush.setTexture( pix );
4878 p.fillRect( imageRect, checkerBrush );
4885 p.drawImage( imageRect.left(), imageRect.top(), image );
4887 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4901 modificationExpressionSelector->setMultiLine(
true );
4902 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4903 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4914 mUnitWidget->setShowMapScaleButton(
false );
4917 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4920 if ( !mBlockSignals )
4922 mLayer->
setUnits( mUnitWidget->unit() );
4933 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData(
static_cast< int >( mLayer->
symbolType() ) ) );
4934 mUnitWidget->setUnit( mLayer->
units() );
4943void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4950void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4953 std::unique_ptr< QgsSymbol > subSymbol( mLayer->
subSymbol()->
clone() );
4968 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4971 layers << subSymbol->symbolLayer( i )->clone();
4974 if ( !layers.empty() )
4984 for (
int i = 0; i < subSymbol->symbolLayerCount(); ++i )
4985 layers << subSymbol->symbolLayer( i )->clone();
5004 mCountMethodComboBox->addItem( tr(
"Absolute Count" ),
static_cast< int >( Qgis::PointCountMethod::Absolute ) );
5005 mCountMethodComboBox->addItem( tr(
"Density-based Count" ),
static_cast< int >( Qgis::PointCountMethod::DensityBased ) );
5007 mPointCountSpinBox->setShowClearButton(
true );
5008 mPointCountSpinBox->setClearValue( 100 );
5009 mSeedSpinBox->setShowClearButton(
true );
5010 mSeedSpinBox->setClearValue( 0 );
5012 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
5013 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
5014 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
5015 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
5016 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
5033 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
5043 bool showDensityBasedCountWidgets =
false;
5046 case Qgis::PointCountMethod::DensityBased:
5047 showDensityBasedCountWidgets =
true;
5049 case Qgis::PointCountMethod::Absolute:
5052 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5053 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5054 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5055 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5057 whileBlocking( mCountMethodComboBox )->setCurrentIndex( mCountMethodComboBox->findData(
static_cast< int >( mLayer->
countMethod() ) ) );
5059 mDensityAreaUnitWidget->blockSignals(
true );
5062 mDensityAreaUnitWidget->blockSignals(
false );
5075void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
5078 bool showDensityBasedCountWidgets =
false;
5081 case Qgis::PointCountMethod::DensityBased:
5082 showDensityBasedCountWidgets =
true;
5084 case Qgis::PointCountMethod::Absolute:
5087 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
5088 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
5089 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
5090 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
5099void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
5108void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
5117void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
5127void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
5146 btnColorRamp->setShowGradientOnly(
true );
5148 btnChangeColor->setAllowOpacity(
true );
5149 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5150 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
5151 btnChangeColor->setShowNoColor(
true );
5152 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
5153 btnChangeColor2->setAllowOpacity(
true );
5154 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
5155 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
5156 btnChangeColor2->setShowNoColor(
true );
5157 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
5159 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
5160 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
5180 if ( btnColorRamp->isNull() )
5190 connect( radioTwoColor, &QAbstractButton::toggled,
this, [ = ]
5194 if ( radioTwoColor->isChecked() )
5196 mLayer->setGradientColorType( Qgis::GradientColorSource::SimpleTwoColor );
5197 btnChangeColor->setEnabled( true );
5198 btnChangeColor2->setEnabled( true );
5199 btnColorRamp->setEnabled( false );
5203 mLayer->setGradientColorType( Qgis::GradientColorSource::ColorRamp );
5204 btnColorRamp->setEnabled( true );
5205 btnChangeColor->setEnabled( false );
5206 btnChangeColor2->setEnabled( false );
5227 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, [ = ]
5246 spinOffset->setClearValue( 0.0 );
5247 connect( spinOffset, qOverload< double >( &QDoubleSpinBox::valueChanged ),
this, [ = ](
double val )
5256 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5264 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
5281 if ( layer->
layerType() != QLatin1String(
"Lineburst" ) )
5292 btnChangeColor->blockSignals(
true );
5294 btnChangeColor->blockSignals(
false );
5295 btnChangeColor2->blockSignals(
true );
5297 btnChangeColor2->blockSignals(
false );
5301 radioTwoColor->setChecked(
true );
5302 btnColorRamp->setEnabled(
false );
5306 radioColorRamp->setChecked(
true );
5307 btnChangeColor->setEnabled(
false );
5308 btnChangeColor2->setEnabled(
false );
5314 btnColorRamp->blockSignals(
true );
5316 btnColorRamp->blockSignals(
false );
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
@ InnerVertices
Inner vertices (i.e. all vertices except the first and last vertex) (since QGIS 3....
@ LastVertex
Place symbols on the last vertex in the line.
@ CentralPoint
Place symbols at the mid point of the line.
@ SegmentCenter
Place symbols at the center of every line segment.
@ Vertex
Place symbols on every vertex in the line.
@ Interval
Place symbols at regular intervals.
@ FirstVertex
Place symbols on the first vertex in the line.
MarkerClipMode
Marker clipping modes.
@ CompletelyWithin
Render complete markers wherever the completely fall within the polygon shape.
@ NoClipping
No clipping, render complete markers.
@ Shape
Clip to polygon shape.
@ CentroidWithin
Render complete markers wherever their centroid falls within the polygon shape.
LineClipMode
Line clipping modes.
@ NoClipping
Lines are not clipped, will extend to shape's bounding box.
@ ClipPainterOnly
Applying clipping on the painter only (i.e. line endpoints will coincide with polygon bounding box,...
@ ClipToIntersection
Clip lines to intersection with polygon shape (slower) (i.e. line endpoints will coincide with polygo...
@ ColorRamp
Gradient color ramp.
@ SimpleTwoColor
Simple two color gradient.
@ Reflect
Reflect gradient.
@ Pad
Pad out gradient using colors at endpoint of gradient.
PointCountMethod
Methods which define the number of points randomly filling a polygon.
MarkerShape
Marker shapes.
@ Conical
Conical (polar) gradient.
@ Radial
Radial (circular) gradient.
SymbolCoordinateReference
Symbol coordinate reference modes.
@ Feature
Relative to feature/shape being rendered.
@ Viewport
Relative to the whole viewport/output device.
static const double UI_SCALE_FACTOR
UI scaling factor.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
void sourceChanged(const QString &source)
Emitted whenever the file source is changed in the widget.
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.
void setAngle(double angle)
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
QgsFilledMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setStrokeColor(const QColor &color) override
Sets the stroke color for the symbol layer.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
double strokeWidth() const
Returns the marker's stroke width.
void setFontStyle(const QString &style)
Sets the font style for the font which will be used to render the point.
QString fontStyle() const
Returns the font style for the associated font which will be used to render the point.
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point.
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
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 bool updateFontViaStyle(QFont &f, const QString &fontstyle, bool fallback=false)
Updates font with named style and retain all font properties.
QString geometryExpression() const
Gets the expression to generate this geometry.
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
void setSymbolType(Qgis::SymbolType symbolType)
Set the type of symbol which should be created.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
Qgis::SymbolType symbolType() const
Access the symbol type.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
void setUnits(QgsUnitTypes::RenderUnit units)
Sets the units for the geometry expression.
QgsUnitTypes::RenderUnit units() const
Returns the unit for the geometry expression.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient fill.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
void setGradientSpread(Qgis::GradientSpread gradientSpread)
Sets the gradient spread mode, which controls how the gradient behaves outside of the predefined stop...
Qgis::SymbolCoordinateReference coordinateMode() const
Returns the coordinate mode for gradient, which controls how the gradient stops are positioned.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
bool referencePoint2IsCentroid() const
Returns whether the end point for the gradient is taken from the feature centroid.
void setGradientType(Qgis::GradientType gradientType)
Sets the type of gradient, e.g., linear or radial.
void setReferencePoint2(QPointF referencePoint)
Sets the end point of gradient fill, in the range [0,0] - [1,1].
void setCoordinateMode(Qgis::SymbolCoordinateReference coordinateMode)
Sets the coordinate mode for gradient, which controls how the gradient stops are positioned.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets whether the end point for the gradient is taken from the feature centroid.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets whether the starting point for the gradient is taken from the feature centroid.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setGradientColorType(Qgis::GradientColorSource gradientColorType)
Sets the gradient color mode, which controls how gradient color stops are created.
QPointF referencePoint1() const
Returns the starting point of gradient fill, in the range [0,0] - [1,1].
Qgis::GradientSpread gradientSpread() const
Returns the gradient spread mode, which controls how the gradient behaves outside of the predefined s...
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.
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
double hashLength() const
Returns the length of hash symbols.
void setHashAngle(double angle)
Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.
static QIcon iconLine()
Returns an icon representing line geometries.
static QIcon iconPolygon()
Returns an icon representing polygon geometries.
static QIcon iconPoint()
Returns an icon representing point geometries.
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.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
Qgis::LineClipMode clipMode() const
Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
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 setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
void setClipMode(Qgis::LineClipMode mode)
Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.
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 setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern's offset.
double distance() const
Returns the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line's offset.
void setOffset(double offset)
Sets the line's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
virtual double width() const
Returns the estimated width for the line symbol layer.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
double offset() const
Returns the line's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
A line symbol type, for rendering LineString and MultiLineString geometries.
Line symbol layer type which draws a gradient pattern perpendicularly along a line.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient line.
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
QColor color() const override
Returns the "representative" color of the symbol layer.
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient line.
Line symbol layer type which draws repeating marker symbols along a line feature.
virtual void setSize(double size)
Sets the symbol size.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setAngle(double angle)
Sets the rotation angle for the marker.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
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.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
VerticalAnchorPoint
Symbol vertical anchor points.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
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.
const QgsMapUnitScale & randomDeviationXMapUnitScale() const
Returns the unit scale for the horizontal random deviation of points in the pattern.
void setOffsetYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
void setRandomDeviationXUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the horizontal random deviation of points in the pattern.
void setOffsetX(double offset)
Sets the horizontal offset values for points in the pattern.
double maximumRandomDeviationY() const
Returns the maximum vertical random deviation of points in the pattern.
QgsUnitTypes::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
double distanceX() const
Returns the horizontal distance between rendered markers in the fill.
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
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.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
void setRandomDeviationXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal random deviation of points in the pattern.
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
QgsUnitTypes::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of points in the pattern.
double offsetY() const
Returns the vertical offset values for points in the pattern.
void setDisplacementY(double d)
Sets the vertical displacement for odd numbered columns in the pattern.
QgsUnitTypes::RenderUnit randomDeviationXUnit() const
Returns the units for the horizontal random deviation of points in the pattern.
void setMaximumRandomDeviationX(double deviation)
Sets the maximum horizontal random deviation of points in the pattern.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setSeed(unsigned long seed)
Sets the random number seed to use when randomly shifting points, or 0 if a truly random sequence wil...
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
QgsUnitTypes::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
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 setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the horizontal distance between points in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal distance between points in the pattern.
const QgsMapUnitScale & displacementYMapUnitScale() const
Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.
const QgsMapUnitScale & randomDeviationYMapUnitScale() const
Returns the unit scale for the vertical random deviation of points in the pattern.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setDistanceY(double d)
Sets the vertical distance between rendered markers in the fill.
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setDistanceX(double d)
Sets the horizontal distance between rendered markers in the fill.
double offsetX() const
Returns the horizontal offset values for points in the pattern.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
void setDisplacementXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
void setMaximumRandomDeviationY(double deviation)
Sets the maximum vertical random deviation of points in the pattern.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical distance between points in the pattern.
void setRandomDeviationYUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the vertical random deviation of points in the pattern.
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
double displacementX() const
Returns the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
double angle() const
Returns the rotation angle of the pattern, in degrees clockwise.
void setOffsetXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the vertical distance between points in the pattern.
void setAngle(double angle)
Sets the rotation angle of the pattern, in degrees clockwise.
double distanceY() const
Returns the vertical distance between rendered markers in the fill.
void setClipMode(Qgis::MarkerClipMode mode)
Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
Definition for a property.
A store for object properties.
void setField(const QString &field)
Sets the field name the property references.
A fill symbol layer which places markers at random locations within polygons.
QgsUnitTypes::RenderUnit densityAreaUnit() const
Returns the units for the density area.
int pointCount() const
Returns the count of random points to render in the fill.
unsigned long seed() const
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be...
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
void setDensityAreaUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the density area.
void setCountMethod(Qgis::PointCountMethod method)
Sets the count method used to randomly fill the polygon.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
void setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
void setPointCount(int count)
Sets the count of random points to render in the fill.
Qgis::PointCountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
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 setWidthUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the image's width.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image's width.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
double opacity() const
Returns the opacity for the raster image used in the fill.
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.
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
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 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.
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the stroke width.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
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 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 setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
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
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
void setColorType(Qgis::GradientColorSource colorType)
Sets the color mode to use for the shapeburst fill.
Qgis::GradientColorSource colorType() const
Returns the color mode used for the shapeburst fill.
const QgsMapUnitScale & distanceMapUnitScale() const
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
Qt::PenJoinStyle penJoinStyle() const
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setBrushStyle(Qt::BrushStyle style)
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
void setPenJoinStyle(Qt::PenJoinStyle style)
Qt::PenStyle strokeStyle() const
double strokeWidth() const
void setStrokeWidth(double strokeWidth)
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
void setStrokeStyle(Qt::PenStyle strokeStyle)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units 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.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill's stroke.
Qt::BrushStyle brushStyle() const
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
QgsUnitTypes::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
bool tweakDashPatternOnCorners() const
Returns true if dash patterns tweaks should be applied on sharp corners, to ensure that a double-leng...
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.
void setDashPatternOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the dash pattern offset.
QgsUnitTypes::RenderUnit trimDistanceStartUnit() const
Returns the unit for the trim distance for the start of the line.
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.
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
void setTrimDistanceEndMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the end of the line.
void setTrimDistanceEnd(double distance)
Sets the trim distance for the end of the line, which dictates a length from the end of the line at w...
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
double trimDistanceStart() const
Returns the trim distance for the start of the line, which dictates a length from the start of the li...
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
void setTweakDashPatternOnCorners(bool enabled)
Sets whether dash patterns tweaks should be applied on sharp corners, to ensure that a double-length ...
double trimDistanceEnd() const
Returns the trim distance for the end of the line, which dictates a length from the end of the line a...
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.
QgsUnitTypes::RenderUnit trimDistanceEndUnit() const
Returns the unit for the trim distance for the end of the line.
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
void setDashPatternOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the dash pattern offset.
QgsSimpleLineSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
double dashPatternOffset() const
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should sta...
void setAlignDashPattern(bool enabled)
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks...
void setTrimDistanceStartUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the trim distance for the start of the line.
void setTrimDistanceStartMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the trim distance for the start of the line.
void setTrimDistanceEndUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the trim distance for the end of the line.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setTrimDistanceStart(double distance)
Sets the trim distance for the start of the line, which dictates a length from the start of the line ...
bool alignDashPattern() const
Returns true if dash patterns should be aligned to the start and end of lines, by applying subtle twe...
static QList< Qgis::MarkerShape > availableShapes()
Returns a list of all available shape types.
static bool shapeIsFilled(Qgis::MarkerShape shape)
Returns true if a symbol shape has a fill.
Qgis::MarkerShape shape() const
Returns the shape for the rendered marker symbol.
static QString encodeShape(Qgis::MarkerShape shape)
Encodes a shape to its string representation.
void setShape(Qgis::MarkerShape shape)
Sets the rendered marker shape.
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker's stroke.
void setColor(const QColor &color) override
Sets the "representative" color for the symbol layer.
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
QgsSimpleMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qt::PenCapStyle penCapStyle() const
Returns the marker's stroke cap style (e.g., flat, round, etc).
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's stroke.
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker's stroke style (e.g., solid, dashed, etc)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
QColor fillColor() const override
Returns the fill color for the symbol layer.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
QColor strokeColor() const override
Returns the marker's stroke color.
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
void setStrokeColor(const QColor &color) override
Sets the marker's stroke color.
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
void setPenCapStyle(Qt::PenCapStyle style)
Sets the marker's stroke cap style (e.g., flat, round, etc).
double strokeWidth() const
Returns the width of the marker's stroke.
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam, double &defaultStrokeWidth, bool blocking=false) const
Tests if an SVG file contains parameters for fill, stroke color, stroke width.
QgsSvgMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
QColor fillColor() const override
Returns the fill color for the symbol layer.
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)
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeWidthUnit(QgsUnitTypes::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
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, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid, QgsMapLayer *mapLayer=nullptr)
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)
Returns a pixmap preview for a color ramp.
static QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr)
Returns an icon preview for a color ramp.
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 setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
double interval() const
Returns the interval between individual symbols.
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
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.
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setInterval(double interval)
Sets the interval between individual symbols.
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
void setPlaceOnEveryPart(bool respect)
Sets whether the placement applies for every part of multi-part feature geometries.
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
void setPlacements(Qgis::MarkerLinePlacements placements)
Sets the placement of the symbols.
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
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< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
@ RenderMetersInMapUnits
Meters value as Map units.
@ RenderPercentage
Percentage of another measurement (e.g., canvas size, feature size)
@ RenderPoints
Points (e.g., for font sizes)
@ RenderMillimeters
Millimeters.
@ RenderMapUnits
Map units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsSymbolLayer * > QgsSymbolLayerList
Single variable definition for use within a QgsExpressionContextScope.