49 #include <QAbstractButton>
50 #include <QButtonGroup>
51 #include <QColorDialog>
54 #include <QFileDialog>
56 #include <QStandardItemModel>
57 #include <QSvgRenderer>
58 #include <QMessageBox>
61 #include <QInputDialog>
63 #include <QRegularExpression>
68 return *lExpressionContext;
79 expContext << symbolScope;
99 QStringList highlights;
104 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" );
107 if ( expContext.
hasVariable( QStringLiteral(
"zoom_level" ) ) )
109 highlights << QStringLiteral(
"zoom_level" );
111 if ( expContext.
hasVariable( QStringLiteral(
"vector_tile_zoom" ) ) )
113 highlights << QStringLiteral(
"vector_tile_zoom" );
124 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
127 unitWidget->setMapCanvas( mContext.
mapCanvas() );
145 void QgsSymbolLayerWidget::createAuxiliaryField()
166 if ( dlg.exec() == QDialog::Accepted )
167 def = dlg.propertyDefinition();
177 property.setActive(
true );
199 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
200 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
204 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
206 connect( mCheckAlignDash, &QCheckBox::toggled,
this, [ = ]
208 mCheckDashCorners->setEnabled( mCheckAlignDash->isChecked() );
209 if ( !mCheckAlignDash->isChecked() )
210 mCheckDashCorners->setChecked(
false );
218 connect( mCheckDashCorners, &QCheckBox::toggled,
this, [ = ]
236 btnChangeColor->setAllowOpacity(
true );
237 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
238 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
240 mColorDDBtn->registerLinkedWidget( btnChangeColor );
245 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
254 spinOffset->setClearValue( 0.0 );
255 spinPatternOffset->setClearValue( 0.0 );
261 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
263 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
265 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
266 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
267 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
268 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
269 connect( spinPatternOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::patternOffsetChanged );
276 void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
278 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
280 mAssistantPreviewSymbol->deleteSymbolLayer( i );
282 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
285 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
291 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
298 mPenWidthUnitWidget->blockSignals(
true );
301 mPenWidthUnitWidget->blockSignals(
false );
302 mOffsetUnitWidget->blockSignals(
true );
305 mOffsetUnitWidget->blockSignals(
false );
306 mDashPatternUnitWidget->blockSignals(
true );
309 mDashPatternUnitWidget->blockSignals(
false );
315 spinWidth->blockSignals(
true );
317 spinWidth->blockSignals(
false );
318 btnChangeColor->blockSignals(
true );
320 btnChangeColor->blockSignals(
false );
321 spinOffset->blockSignals(
true );
323 spinOffset->blockSignals(
false );
324 cboPenStyle->blockSignals(
true );
325 cboJoinStyle->blockSignals(
true );
326 cboCapStyle->blockSignals(
true );
330 cboPenStyle->blockSignals(
false );
331 cboJoinStyle->blockSignals(
false );
332 cboCapStyle->blockSignals(
false );
337 mChangePatternButton->setEnabled( useCustomDashPattern );
338 label_3->setEnabled( !useCustomDashPattern );
339 cboPenStyle->setEnabled( !useCustomDashPattern );
340 mCustomCheckBox->blockSignals(
true );
341 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
342 mCustomCheckBox->blockSignals(
false );
345 QSize size = mChangePatternButton->minimumSizeHint();
347 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
351 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
370 updateAssistantSymbol();
387 mDrawInsideCheckBox->hide();
388 mRingFilterComboBox->hide();
398 void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
405 void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
411 void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
420 void QgsSimpleLineSymbolLayerWidget::offsetChanged()
427 void QgsSimpleLineSymbolLayerWidget::patternOffsetChanged()
434 void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
436 bool checked = ( state == Qt::Checked );
437 mChangePatternButton->setEnabled( checked );
438 label_3->setEnabled( !checked );
439 cboPenStyle->setEnabled( !checked );
445 void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
452 widget->
setUnit( mDashPatternUnitWidget->unit() );
464 d.setUnit( mDashPatternUnitWidget->unit() );
465 if ( d.exec() == QDialog::Accepted )
473 void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
484 void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
494 void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
505 void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
507 bool checked = ( state == Qt::Checked );
512 void QgsSimpleLineSymbolLayerWidget::patternOffsetUnitChanged()
529 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
534 QColor color = qApp->palette().color( QPalette::WindowText );
535 layerCopy->setColor( color );
537 layerCopy->setOffset( 0 );
538 layerCopy->setUseCustomDashPattern(
true );
540 QSize currentIconSize;
543 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
545 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
548 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
554 std::unique_ptr< QgsLineSymbol > previewSymbol = qgis::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
556 mChangePatternButton->setIconSize( currentIconSize );
557 mChangePatternButton->setIcon( icon );
561 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
564 int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
566 int height =
static_cast< int >( width / 1.61803398875 );
570 QBuffer buffer( &data );
571 pm.save( &buffer,
"PNG", 100 );
572 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
577 QgsSymbolLayerWidget::resizeEvent( event );
595 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
596 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
597 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
598 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
606 btnChangeColorFill->setAllowOpacity(
true );
607 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
608 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
609 btnChangeColorFill->setShowNoColor(
true );
610 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
611 btnChangeColorStroke->setAllowOpacity(
true );
612 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
613 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
614 btnChangeColorStroke->setShowNoColor(
true );
615 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
617 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
618 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
620 spinOffsetX->setClearValue( 0.0 );
621 spinOffsetY->setClearValue( 0.0 );
622 spinAngle->setClearValue( 0.0 );
628 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
630 int size = lstNames->iconSize().width();
632 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
633 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
635 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
638 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
639 lstNames->setIconSize( QSize( size, size ) );
641 double markerSize = size * 0.8;
647 lyr->
setColor( QColor( 200, 200, 200 ) );
650 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
651 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
656 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
658 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
661 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
662 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
663 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
664 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
665 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
671 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
679 for (
int i = 0; i < lstNames->count(); ++i )
683 lstNames->setCurrentRow( i );
687 btnChangeColorStroke->blockSignals(
true );
689 btnChangeColorStroke->blockSignals(
false );
690 btnChangeColorFill->blockSignals(
true );
693 btnChangeColorFill->blockSignals(
false );
694 spinSize->blockSignals(
true );
696 spinSize->blockSignals(
false );
697 spinAngle->blockSignals(
true );
699 spinAngle->blockSignals(
false );
700 mStrokeStyleComboBox->blockSignals(
true );
702 mStrokeStyleComboBox->blockSignals(
false );
703 mStrokeWidthSpinBox->blockSignals(
true );
705 mStrokeWidthSpinBox->blockSignals(
false );
706 cboJoinStyle->blockSignals(
true );
708 cboJoinStyle->blockSignals(
false );
711 spinOffsetX->blockSignals(
true );
713 spinOffsetX->blockSignals(
false );
714 spinOffsetY->blockSignals(
true );
716 spinOffsetY->blockSignals(
false );
718 mSizeUnitWidget->blockSignals(
true );
721 mSizeUnitWidget->blockSignals(
false );
722 mOffsetUnitWidget->blockSignals(
true );
725 mOffsetUnitWidget->blockSignals(
false );
726 mStrokeWidthUnitWidget->blockSignals(
true );
729 mStrokeWidthUnitWidget->blockSignals(
false );
732 mHorizontalAnchorComboBox->blockSignals(
true );
733 mVerticalAnchorComboBox->blockSignals(
true );
736 mHorizontalAnchorComboBox->blockSignals(
false );
737 mVerticalAnchorComboBox->blockSignals(
false );
751 updateAssistantSymbol();
759 void QgsSimpleMarkerSymbolLayerWidget::setShape()
778 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
784 void QgsSimpleMarkerSymbolLayerWidget::setSize()
790 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
796 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
798 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
802 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
813 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
822 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
832 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
842 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
852 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
861 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
870 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
872 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
874 mAssistantPreviewSymbol->deleteSymbolLayer( i );
876 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
879 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
898 btnChangeColor->setAllowOpacity(
true );
899 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
900 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
901 btnChangeColor->setShowNoColor(
true );
902 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
903 btnChangeStrokeColor->setAllowOpacity(
true );
904 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
905 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
906 btnChangeStrokeColor->setShowNoColor(
true );
907 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
909 spinOffsetX->setClearValue( 0.0 );
910 spinOffsetY->setClearValue( 0.0 );
913 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
915 connect( spinStrokeWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
916 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
917 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
918 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
919 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
921 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
922 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
927 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
934 btnChangeColor->blockSignals(
true );
936 btnChangeColor->blockSignals(
false );
937 cboFillStyle->blockSignals(
true );
939 cboFillStyle->blockSignals(
false );
940 btnChangeStrokeColor->blockSignals(
true );
942 btnChangeStrokeColor->blockSignals(
false );
943 cboStrokeStyle->blockSignals(
true );
945 cboStrokeStyle->blockSignals(
false );
946 spinStrokeWidth->blockSignals(
true );
948 spinStrokeWidth->blockSignals(
false );
949 cboJoinStyle->blockSignals(
true );
951 cboJoinStyle->blockSignals(
false );
952 spinOffsetX->blockSignals(
true );
954 spinOffsetX->blockSignals(
false );
955 spinOffsetY->blockSignals(
true );
957 spinOffsetY->blockSignals(
false );
959 mStrokeWidthUnitWidget->blockSignals(
true );
962 mStrokeWidthUnitWidget->blockSignals(
false );
963 mOffsetUnitWidget->blockSignals(
true );
966 mOffsetUnitWidget->blockSignals(
false );
994 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
1000 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
1006 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
1013 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
1015 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1019 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
1029 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1049 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1050 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1056 spinOffsetX->setClearValue( 0.0 );
1057 spinOffsetY->setClearValue( 0.0 );
1058 spinAngle->setClearValue( 0.0 );
1064 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
1066 int size = lstNames->iconSize().width();
1067 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
1068 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
1070 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
1072 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
1073 lstNames->setIconSize( QSize( size, size ) );
1075 double markerSize = size * 0.8;
1081 lyr->
setColor( QColor( 200, 200, 200 ) );
1084 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1085 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
1090 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1092 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1093 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1094 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1095 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1096 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1102 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1110 for (
int i = 0; i < lstNames->count(); ++i )
1114 lstNames->setCurrentRow( i );
1123 mSizeUnitWidget->blockSignals(
true );
1126 mSizeUnitWidget->blockSignals(
false );
1127 mOffsetUnitWidget->blockSignals(
true );
1130 mOffsetUnitWidget->blockSignals(
false );
1143 updateAssistantSymbol();
1151 void QgsFilledMarkerSymbolLayerWidget::setShape()
1157 void QgsFilledMarkerSymbolLayerWidget::setSize()
1163 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1169 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1171 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1175 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1185 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1195 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1204 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1213 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1215 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1217 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1219 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1222 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1235 connect( mSpinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1239 btnColorRamp->setShowGradientOnly(
true );
1241 btnChangeColor->setAllowOpacity(
true );
1242 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1243 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1244 btnChangeColor->setShowNoColor(
true );
1245 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1246 btnChangeColor2->setAllowOpacity(
true );
1247 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1248 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1249 btnChangeColor2->setShowNoColor(
true );
1250 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1252 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1253 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1255 spinOffsetX->setClearValue( 0.0 );
1256 spinOffsetY->setClearValue( 0.0 );
1257 mSpinAngle->setClearValue( 0.0 );
1265 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1266 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1267 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1268 connect( spinRefPoint1X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1269 connect( spinRefPoint1Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1270 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1271 connect( spinRefPoint2X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1272 connect( spinRefPoint2Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1273 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1278 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1285 btnChangeColor->blockSignals(
true );
1287 btnChangeColor->blockSignals(
false );
1288 btnChangeColor2->blockSignals(
true );
1290 btnChangeColor2->blockSignals(
false );
1294 radioTwoColor->setChecked(
true );
1295 btnColorRamp->setEnabled(
false );
1299 radioColorRamp->setChecked(
true );
1300 btnChangeColor->setEnabled(
false );
1301 btnChangeColor2->setEnabled(
false );
1307 btnColorRamp->blockSignals(
true );
1309 btnColorRamp->blockSignals(
false );
1312 cboGradientType->blockSignals(
true );
1316 cboGradientType->setCurrentIndex( 0 );
1319 cboGradientType->setCurrentIndex( 1 );
1322 cboGradientType->setCurrentIndex( 2 );
1325 cboGradientType->blockSignals(
false );
1327 cboCoordinateMode->blockSignals(
true );
1331 cboCoordinateMode->setCurrentIndex( 1 );
1332 checkRefPoint1Centroid->setEnabled(
false );
1333 checkRefPoint2Centroid->setEnabled(
false );
1337 cboCoordinateMode->setCurrentIndex( 0 );
1340 cboCoordinateMode->blockSignals(
false );
1342 cboGradientSpread->blockSignals(
true );
1346 cboGradientSpread->setCurrentIndex( 0 );
1349 cboGradientSpread->setCurrentIndex( 1 );
1352 cboGradientSpread->setCurrentIndex( 2 );
1355 cboGradientSpread->blockSignals(
false );
1357 spinRefPoint1X->blockSignals(
true );
1359 spinRefPoint1X->blockSignals(
false );
1360 spinRefPoint1Y->blockSignals(
true );
1362 spinRefPoint1Y->blockSignals(
false );
1363 checkRefPoint1Centroid->blockSignals(
true );
1367 spinRefPoint1X->setEnabled(
false );
1368 spinRefPoint1Y->setEnabled(
false );
1370 checkRefPoint1Centroid->blockSignals(
false );
1371 spinRefPoint2X->blockSignals(
true );
1373 spinRefPoint2X->blockSignals(
false );
1374 spinRefPoint2Y->blockSignals(
true );
1376 spinRefPoint2Y->blockSignals(
false );
1377 checkRefPoint2Centroid->blockSignals(
true );
1381 spinRefPoint2X->setEnabled(
false );
1382 spinRefPoint2Y->setEnabled(
false );
1384 checkRefPoint2Centroid->blockSignals(
false );
1386 spinOffsetX->blockSignals(
true );
1388 spinOffsetX->blockSignals(
false );
1389 spinOffsetY->blockSignals(
true );
1391 spinOffsetY->blockSignals(
false );
1392 mSpinAngle->blockSignals(
true );
1394 mSpinAngle->blockSignals(
false );
1396 mOffsetUnitWidget->blockSignals(
true );
1399 mOffsetUnitWidget->blockSignals(
false );
1433 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1435 if ( radioTwoColor->isChecked() )
1448 if ( btnColorRamp->isNull() )
1462 spinRefPoint1X->setValue( 0.5 );
1463 spinRefPoint1Y->setValue( 0 );
1464 spinRefPoint2X->setValue( 0.5 );
1465 spinRefPoint2Y->setValue( 1 );
1470 spinRefPoint1X->setValue( 0 );
1471 spinRefPoint1Y->setValue( 0 );
1472 spinRefPoint2X->setValue( 1 );
1473 spinRefPoint2Y->setValue( 1 );
1477 spinRefPoint1X->setValue( 0.5 );
1478 spinRefPoint1Y->setValue( 0.5 );
1479 spinRefPoint2X->setValue( 1 );
1480 spinRefPoint2Y->setValue( 1 );
1495 checkRefPoint1Centroid->setEnabled(
true );
1496 checkRefPoint2Centroid->setEnabled(
true );
1502 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1503 checkRefPoint1Centroid->setEnabled(
false );
1504 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1505 checkRefPoint2Centroid->setEnabled(
false );
1530 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1532 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1536 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1545 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1551 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1569 connect( mSpinBlurRadius, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1570 connect( mSpinMaxDistance, qgis::overload< double >::of( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1572 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1574 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1580 QButtonGroup *group1 =
new QButtonGroup(
this );
1581 group1->addButton( radioColorRamp );
1582 group1->addButton( radioTwoColor );
1583 QButtonGroup *group2 =
new QButtonGroup(
this );
1584 group2->addButton( mRadioUseMaxDistance );
1585 group2->addButton( mRadioUseWholeShape );
1586 btnChangeColor->setAllowOpacity(
true );
1587 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1588 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1589 btnChangeColor->setShowNoColor(
true );
1590 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1591 btnChangeColor2->setAllowOpacity(
true );
1592 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1593 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1594 btnChangeColor2->setShowNoColor(
true );
1595 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1597 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1598 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1600 spinOffsetX->setClearValue( 0.0 );
1601 spinOffsetY->setClearValue( 0.0 );
1602 mSpinMaxDistance->setClearValue( 5.0 );
1604 btnColorRamp->setShowGradientOnly(
true );
1610 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1611 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1612 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1614 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1615 connect( mSpinBlurRadius,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1620 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1627 btnChangeColor->blockSignals(
true );
1629 btnChangeColor->blockSignals(
false );
1630 btnChangeColor2->blockSignals(
true );
1632 btnChangeColor2->blockSignals(
false );
1636 radioTwoColor->setChecked(
true );
1637 btnColorRamp->setEnabled(
false );
1641 radioColorRamp->setChecked(
true );
1642 btnChangeColor->setEnabled(
false );
1643 btnChangeColor2->setEnabled(
false );
1646 mSpinBlurRadius->blockSignals(
true );
1647 mBlurSlider->blockSignals(
true );
1650 mSpinBlurRadius->blockSignals(
false );
1651 mBlurSlider->blockSignals(
false );
1653 mSpinMaxDistance->blockSignals(
true );
1655 mSpinMaxDistance->blockSignals(
false );
1657 mRadioUseWholeShape->blockSignals(
true );
1658 mRadioUseMaxDistance->blockSignals(
true );
1661 mRadioUseWholeShape->setChecked(
true );
1662 mSpinMaxDistance->setEnabled(
false );
1663 mDistanceUnitWidget->setEnabled(
false );
1667 mRadioUseMaxDistance->setChecked(
true );
1668 mSpinMaxDistance->setEnabled(
true );
1669 mDistanceUnitWidget->setEnabled(
true );
1671 mRadioUseWholeShape->blockSignals(
false );
1672 mRadioUseMaxDistance->blockSignals(
false );
1674 mDistanceUnitWidget->blockSignals(
true );
1677 mDistanceUnitWidget->blockSignals(
false );
1679 mIgnoreRingsCheckBox->blockSignals(
true );
1680 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1681 mIgnoreRingsCheckBox->blockSignals(
false );
1686 btnColorRamp->blockSignals(
true );
1688 btnColorRamp->blockSignals(
false );
1691 spinOffsetX->blockSignals(
true );
1693 spinOffsetX->blockSignals(
false );
1694 spinOffsetY->blockSignals(
true );
1696 spinOffsetY->blockSignals(
false );
1697 mOffsetUnitWidget->blockSignals(
true );
1700 mOffsetUnitWidget->blockSignals(
false );
1734 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1741 if ( radioTwoColor->isChecked() )
1752 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1761 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1770 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1780 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1785 mDistanceUnitWidget->setEnabled( !value );
1790 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1800 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1804 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1809 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1820 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1822 bool checked = ( state == Qt::Checked );
1851 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1860 spinOffset->setClearValue( 0.0 );
1862 mSpinAverageAngleLength->setClearValue( 4.0 );
1866 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1867 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1868 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1869 connect( radInterval, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1870 connect( radVertex, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1871 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1872 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1873 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1874 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1875 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1880 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1887 spinInterval->blockSignals(
true );
1889 spinInterval->blockSignals(
false );
1890 mSpinOffsetAlongLine->blockSignals(
true );
1892 mSpinOffsetAlongLine->blockSignals(
false );
1893 chkRotateMarker->blockSignals(
true );
1895 chkRotateMarker->blockSignals(
false );
1896 spinOffset->blockSignals(
true );
1898 spinOffset->blockSignals(
false );
1900 radInterval->setChecked(
true );
1902 radVertex->setChecked(
true );
1904 radVertexLast->setChecked(
true );
1906 radCentralPoint->setChecked(
true );
1908 radCurvePoint->setChecked(
true );
1910 radSegmentCentralPoint->setChecked(
true );
1912 radVertexFirst->setChecked(
true );
1915 mIntervalUnitWidget->blockSignals(
true );
1918 mIntervalUnitWidget->blockSignals(
false );
1919 mOffsetUnitWidget->blockSignals(
true );
1922 mOffsetUnitWidget->blockSignals(
false );
1923 mOffsetAlongLineUnitWidget->blockSignals(
true );
1926 mOffsetAlongLineUnitWidget->blockSignals(
false );
1957 mRingFilterComboBox->hide();
1958 mRingsLabel->hide();
1979 void QgsMarkerLineSymbolLayerWidget::setRotate()
1981 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1982 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1988 void QgsMarkerLineSymbolLayerWidget::setOffset()
1994 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1996 bool interval = radInterval->isChecked();
1997 spinInterval->setEnabled( interval );
1998 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1999 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2000 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2001 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2003 if ( radInterval->isChecked() )
2005 else if ( radVertex->isChecked() )
2007 else if ( radVertexLast->isChecked() )
2009 else if ( radVertexFirst->isChecked() )
2011 else if ( radCurvePoint->isChecked() )
2013 else if ( radSegmentCentralPoint->isChecked() )
2021 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2031 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2041 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2051 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
2061 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2098 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2107 spinOffset->setClearValue( 0.0 );
2109 mHashRotationSpinBox->setClearValue( 0 );
2110 mSpinAverageAngleLength->setClearValue( 4.0 );
2112 connect( spinInterval,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2113 connect( mSpinOffsetAlongLine,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2114 connect( mSpinHashLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2115 connect( mHashRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2116 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2117 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2118 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2119 connect( radInterval, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2120 connect( radVertex, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2121 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2122 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2123 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2124 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2125 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2130 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2137 spinInterval->blockSignals(
true );
2138 spinInterval->setValue( mLayer->
interval() );
2139 spinInterval->blockSignals(
false );
2140 mSpinOffsetAlongLine->blockSignals(
true );
2142 mSpinOffsetAlongLine->blockSignals(
false );
2145 chkRotateMarker->blockSignals(
true );
2147 chkRotateMarker->blockSignals(
false );
2148 spinOffset->blockSignals(
true );
2149 spinOffset->setValue( mLayer->
offset() );
2150 spinOffset->blockSignals(
false );
2152 radInterval->setChecked(
true );
2154 radVertex->setChecked(
true );
2156 radVertexLast->setChecked(
true );
2158 radCentralPoint->setChecked(
true );
2160 radCurvePoint->setChecked(
true );
2162 radSegmentCentralPoint->setChecked(
true );
2164 radVertexFirst->setChecked(
true );
2167 mIntervalUnitWidget->blockSignals(
true );
2168 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2170 mIntervalUnitWidget->blockSignals(
false );
2171 mOffsetUnitWidget->blockSignals(
true );
2172 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2174 mOffsetUnitWidget->blockSignals(
false );
2175 mOffsetAlongLineUnitWidget->blockSignals(
true );
2178 mOffsetAlongLineUnitWidget->blockSignals(
false );
2185 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2212 mRingFilterComboBox->hide();
2213 mRingsLabel->hide();
2222 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2228 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2234 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2240 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2246 void QgsHashedLineSymbolLayerWidget::setRotate()
2248 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2249 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2255 void QgsHashedLineSymbolLayerWidget::setOffset()
2257 mLayer->
setOffset( spinOffset->value() );
2261 void QgsHashedLineSymbolLayerWidget::setPlacement()
2263 bool interval = radInterval->isChecked();
2264 spinInterval->setEnabled( interval );
2265 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
2266 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2267 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2268 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2270 if ( radInterval->isChecked() )
2272 else if ( radVertex->isChecked() )
2274 else if ( radVertexLast->isChecked() )
2276 else if ( radVertexFirst->isChecked() )
2278 else if ( radCurvePoint->isChecked() )
2280 else if ( radSegmentCentralPoint->isChecked() )
2288 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2298 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2308 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2318 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2328 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2338 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2357 mSvgSelectorWidget->setAllowParameters(
true );
2358 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2359 mSvgSelectorWidget->sourceLineEdit()->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2360 mSvgSelectorWidget->initParametersModel(
this, vl );
2364 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2365 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2369 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2370 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2377 mChangeColorButton->setAllowOpacity(
true );
2378 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2379 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2380 mChangeStrokeColorButton->setAllowOpacity(
true );
2381 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2382 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2384 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2385 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2387 spinOffsetX->setClearValue( 0.0 );
2388 spinOffsetY->setClearValue( 0.0 );
2389 spinAngle->setClearValue( 0.0 );
2391 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2392 connect( spinHeight,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2394 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2395 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2396 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2407 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2408 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2413 #include <QAbstractListModel>
2414 #include <QPixmapCache>
2428 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2429 QColor defaultFill, defaultStroke;
2430 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2431 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2433 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2434 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2435 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2436 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2437 mChangeColorButton->setEnabled( hasFillParam );
2438 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2439 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2440 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2441 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2446 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2447 if ( hasDefaultFillColor && !skipDefaultColors )
2451 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2452 mChangeColorButton->setColor( fill );
2454 if ( hasStrokeParam )
2457 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2458 if ( hasDefaultStrokeColor && !skipDefaultColors )
2460 stroke = defaultStroke;
2462 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2463 mChangeStrokeColorButton->setColor( stroke );
2466 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( layer->
path() );
2468 mStrokeWidthSpinBox->blockSignals(
true );
2469 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2470 mStrokeWidthSpinBox->blockSignals(
false );
2473 spinHeight->blockSignals(
true );
2474 if ( preservedAspectRatio )
2483 spinHeight->blockSignals(
false );
2484 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2487 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2489 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2491 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2493 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2496 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2507 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2514 mSvgSelectorWidget->setSvgPath(
mLayer->
path() );
2517 spinWidth->blockSignals(
true );
2519 spinWidth->blockSignals(
false );
2520 spinAngle->blockSignals(
true );
2522 spinAngle->blockSignals(
false );
2525 spinOffsetX->blockSignals(
true );
2527 spinOffsetX->blockSignals(
false );
2528 spinOffsetY->blockSignals(
true );
2530 spinOffsetY->blockSignals(
false );
2532 mSizeUnitWidget->blockSignals(
true );
2535 mSizeUnitWidget->blockSignals(
false );
2536 mStrokeWidthUnitWidget->blockSignals(
true );
2539 mStrokeWidthUnitWidget->blockSignals(
false );
2540 mOffsetUnitWidget->blockSignals(
true );
2543 mOffsetUnitWidget->blockSignals(
false );
2546 mHorizontalAnchorComboBox->blockSignals(
true );
2547 mVerticalAnchorComboBox->blockSignals(
true );
2550 mHorizontalAnchorComboBox->blockSignals(
false );
2551 mVerticalAnchorComboBox->blockSignals(
false );
2567 updateAssistantSymbol();
2584 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2593 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2599 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2602 double fixedAspectRatio = 0.0;
2603 spinHeight->blockSignals(
true );
2604 if ( defaultAspectRatio <= 0.0 )
2606 spinHeight->setValue( spinWidth->value() );
2608 else if ( mLockAspectRatio->locked() )
2610 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2614 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2616 spinHeight->blockSignals(
false );
2622 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2625 double fixedAspectRatio = 0.0;
2626 spinWidth->blockSignals(
true );
2627 if ( defaultAspectRatio <= 0.0 )
2629 spinWidth->setValue( spinHeight->value() );
2631 else if ( mLockAspectRatio->locked() )
2633 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2637 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2639 spinWidth->blockSignals(
false );
2645 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2649 if ( defaultAspectRatio <= 0.0 )
2665 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2671 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2673 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2677 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2684 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2695 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2706 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2715 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2725 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2735 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2745 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2754 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2770 mSvgSelectorWidget->setAllowParameters(
true );
2771 mSvgSelectorWidget->sourceLineEdit()->setPropertyOverrideToolButtonVisible(
true );
2773 connect( mTextureWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2775 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2777 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2778 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2786 mRotationSpinBox->setClearValue( 0.0 );
2788 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2789 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2790 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2791 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2793 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2794 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2807 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2816 mTextureWidthSpinBox->blockSignals(
true );
2817 mTextureWidthSpinBox->setValue( width );
2818 mTextureWidthSpinBox->blockSignals(
false );
2820 mRotationSpinBox->blockSignals(
true );
2822 mRotationSpinBox->blockSignals(
false );
2823 mTextureWidthUnitWidget->blockSignals(
true );
2826 mTextureWidthUnitWidget->blockSignals(
false );
2827 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2830 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2831 mChangeColorButton->blockSignals(
true );
2833 mChangeColorButton->blockSignals(
false );
2834 mChangeStrokeColorButton->blockSignals(
true );
2836 mChangeStrokeColorButton->blockSignals(
false );
2837 mStrokeWidthSpinBox->blockSignals(
true );
2839 mStrokeWidthSpinBox->blockSignals(
false );
2863 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2872 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2884 void QgsSVGFillSymbolLayerWidget::setFile(
const QString &name )
2887 whileBlocking( mSvgSelectorWidget->sourceLineEdit() )->setSource( name );
2893 void QgsSVGFillSymbolLayerWidget::setSvgParameters(
const QMap<QString, QgsProperty> ¶meters )
2896 whileBlocking( mSvgSelectorWidget )->setSvgParameters( parameters );
2903 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2915 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2916 QColor defaultFill, defaultStroke;
2917 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2918 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2920 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2921 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2922 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2923 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2926 QColor fill = mChangeColorButton->color();
2927 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2928 if ( hasDefaultFillColor )
2932 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2933 mChangeColorButton->setColor( fill );
2935 mChangeColorButton->setEnabled( hasFillParam );
2936 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2939 QColor stroke = mChangeStrokeColorButton->color();
2940 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2941 if ( hasDefaultStrokeColor )
2943 stroke = defaultStroke;
2945 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2946 mChangeStrokeColorButton->setColor( stroke );
2948 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2949 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2950 if ( hasDefaultStrokeWidth && resetValues )
2952 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2954 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2957 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2968 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2979 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2988 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2998 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
3014 connect( mAngleSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
3015 connect( mDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
3016 connect( mOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
3023 mOffsetSpinBox->setClearValue( 0 );
3024 mAngleSpinBox->setClearValue( 0 );
3029 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3038 mAngleSpinBox->blockSignals(
true );
3040 mAngleSpinBox->blockSignals(
false );
3041 mDistanceSpinBox->blockSignals(
true );
3043 mDistanceSpinBox->blockSignals(
false );
3044 mOffsetSpinBox->blockSignals(
true );
3046 mOffsetSpinBox->blockSignals(
false );
3049 mDistanceUnitWidget->blockSignals(
true );
3052 mDistanceUnitWidget->blockSignals(
false );
3053 mOffsetUnitWidget->blockSignals(
true );
3056 mOffsetUnitWidget->blockSignals(
false );
3068 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3077 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3086 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3095 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3105 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3121 connect( mHorizontalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3122 connect( mVerticalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3123 connect( mHorizontalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3124 connect( mVerticalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3125 connect( mHorizontalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3126 connect( mVerticalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3127 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3128 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3129 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3130 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3131 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3132 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3150 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3163 mHorizontalDistanceUnitWidget->blockSignals(
true );
3166 mHorizontalDistanceUnitWidget->blockSignals(
false );
3167 mVerticalDistanceUnitWidget->blockSignals(
true );
3170 mVerticalDistanceUnitWidget->blockSignals(
false );
3171 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3174 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3175 mVerticalDisplacementUnitWidget->blockSignals(
true );
3178 mVerticalDisplacementUnitWidget->blockSignals(
false );
3179 mHorizontalOffsetUnitWidget->blockSignals(
true );
3182 mHorizontalOffsetUnitWidget->blockSignals(
false );
3183 mVerticalOffsetUnitWidget->blockSignals(
true );
3186 mVerticalOffsetUnitWidget->blockSignals(
false );
3201 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3210 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3219 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3228 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3237 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3246 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3255 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3265 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3275 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3285 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3295 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3305 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3326 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3327 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3328 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3338 scrollArea->setVerticalOnly(
true );
3340 btnColor->setAllowOpacity(
true );
3341 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3342 btnColor->setContext( QStringLiteral(
"symbology" ) );
3343 btnStrokeColor->setAllowOpacity(
true );
3344 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3345 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3347 mColorDDBtn->registerLinkedWidget( btnColor );
3348 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3350 spinOffsetX->setClearValue( 0.0 );
3351 spinOffsetY->setClearValue( 0.0 );
3352 spinAngle->setClearValue( 0.0 );
3358 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3361 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3363 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3366 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3368 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3369 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3378 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3387 mFontStyleComboBox->blockSignals(
true );
3388 populateFontStyleComboBox();
3389 mFontStyleComboBox->blockSignals(
false );
3407 mCharPreview->setFont( mRefFont );
3413 mSizeUnitWidget->blockSignals(
true );
3416 mSizeUnitWidget->blockSignals(
false );
3418 mStrokeWidthUnitWidget->blockSignals(
true );
3421 mStrokeWidthUnitWidget->blockSignals(
false );
3423 mOffsetUnitWidget->blockSignals(
true );
3426 mOffsetUnitWidget->blockSignals(
false );
3447 updateAssistantSymbol();
3460 mRefFont.setFamily( font.family() );
3462 mCharPreview->setFont( mRefFont );
3463 populateFontStyleComboBox();
3468 void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3475 mCharPreview->setFont( mRefFont );
3507 mCharPreview->setText( text );
3509 if ( text.isEmpty() )
3513 QString character = text;
3514 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3517 unsigned int value = text.toUInt( &ok, 0 );
3520 character = QChar( value );
3521 mCharPreview->setText( character );
3542 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3544 mCharLineEdit->insert( chr );
3550 mCharPreview->setText( chr );
3554 void QgsFontMarkerSymbolLayerWidget::setOffset()
3556 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3560 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3566 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3576 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3586 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3596 void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3598 mFontStyleComboBox->clear();
3599 QStringList styles = mFontDB.styles( mRefFont.family() );
3600 const auto constStyles = styles;
3601 for (
const QString &style : constStyles )
3603 mFontStyleComboBox->addItem( style );
3606 QString targetStyle = mFontDB.styleString( mRefFont );
3607 if ( !styles.contains( targetStyle ) )
3609 QFont f = QFont( mRefFont.family() );
3610 targetStyle = QFontInfo( f ).styleName();
3611 mRefFont.setStyleName( targetStyle );
3614 int stylIndx = mFontStyleComboBox->findText( targetStyle );
3615 if ( stylIndx > -1 )
3620 mFontStyleComboBox->setCurrentIndex( curIndx );
3623 void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3626 setFontStyle( mFontStyleComboBox->currentText() );
3629 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3638 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3647 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3656 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3658 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3660 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3662 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3665 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3677 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3678 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3679 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3680 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3685 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3703 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3709 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3715 void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3721 void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3736 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3740 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3742 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3743 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3751 mSpinOffsetX->setClearValue( 0.0 );
3752 mSpinOffsetY->setClearValue( 0.0 );
3753 mRotationSpinBox->setClearValue( 0.0 );
3755 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3756 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3759 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3760 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3770 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3781 mHeightSpinBox->blockSignals(
true );
3782 if ( preservedAspectRatio )
3791 mHeightSpinBox->blockSignals(
false );
3792 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3800 mSizeUnitWidget->blockSignals(
true );
3803 mSizeUnitWidget->blockSignals(
false );
3804 mOffsetUnitWidget->blockSignals(
true );
3807 mOffsetUnitWidget->blockSignals(
false );
3822 updatePreviewImage();
3836 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3839 updatePreviewImage();
3843 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3845 bool fitsInCache =
false;
3847 if ( image.isNull() )
3849 mLabelImagePreview->setPixmap( QPixmap() );
3853 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3854 previewImage.fill( Qt::transparent );
3855 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3857 p.begin( &previewImage );
3859 uchar pixDataRGB[] = { 150, 150, 150, 150,
3864 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3865 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3866 QBrush checkerBrush;
3867 checkerBrush.setTexture( pix );
3868 p.fillRect( imageRect, checkerBrush );
3875 p.drawImage( imageRect.left(), imageRect.top(), image );
3877 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3880 void QgsRasterMarkerSymbolLayerWidget::setWidth()
3883 double fixedAspectRatio = 0.0;
3884 mHeightSpinBox->blockSignals(
true );
3885 if ( defaultAspectRatio <= 0.0 )
3887 mHeightSpinBox->setValue( mWidthSpinBox->value() );
3889 else if ( mLockAspectRatio->locked() )
3891 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
3895 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3897 mHeightSpinBox->blockSignals(
false );
3903 void QgsRasterMarkerSymbolLayerWidget::setHeight()
3906 double fixedAspectRatio = 0.0;
3907 mWidthSpinBox->blockSignals(
true );
3908 if ( defaultAspectRatio <= 0.0 )
3910 mWidthSpinBox->setValue( mHeightSpinBox->value() );
3912 else if ( mLockAspectRatio->locked() )
3914 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
3918 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3920 mWidthSpinBox->blockSignals(
false );
3926 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
3929 if ( defaultAspectRatio <= 0.0 )
3944 void QgsRasterMarkerSymbolLayerWidget::setAngle()
3950 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
3954 updatePreviewImage();
3957 void QgsRasterMarkerSymbolLayerWidget::setOffset()
3959 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3963 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3973 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3983 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3992 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
4009 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
4013 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
4015 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
4022 mSpinOffsetX->setClearValue( 0.0 );
4023 mSpinOffsetY->setClearValue( 0.0 );
4024 mRotationSpinBox->setClearValue( 0.0 );
4026 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
4027 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4028 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4040 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4053 cboCoordinateMode->blockSignals(
true );
4057 cboCoordinateMode->setCurrentIndex( 1 );
4061 cboCoordinateMode->setCurrentIndex( 0 );
4064 cboCoordinateMode->blockSignals(
false );
4070 mOffsetUnitWidget->blockSignals(
true );
4073 mOffsetUnitWidget->blockSignals(
false );
4076 mWidthUnitWidget->blockSignals(
true );
4079 mWidthUnitWidget->blockSignals(
false );
4081 updatePreviewImage();
4095 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4098 updatePreviewImage();
4102 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4119 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4128 updatePreviewImage();
4131 void QgsRasterFillSymbolLayerWidget::offsetChanged()
4133 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4137 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4148 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4157 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4168 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4178 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4180 bool fitsInCache =
false;
4182 if ( image.isNull() )
4184 mLabelImagePreview->setPixmap( QPixmap() );
4188 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4189 previewImage.fill( Qt::transparent );
4190 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4192 p.begin( &previewImage );
4194 uchar pixDataRGB[] = { 150, 150, 150, 150,
4199 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4200 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4201 QBrush checkerBrush;
4202 checkerBrush.setTexture( pix );
4203 p.fillRect( imageRect, checkerBrush );
4210 p.drawImage( imageRect.left(), imageRect.top(), image );
4212 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4221 modificationExpressionSelector->setMultiLine(
true );
4222 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4223 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4228 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4235 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
4243 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4250 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4270 mPointCountSpinBox->setShowClearButton(
true );
4271 mPointCountSpinBox->setClearValue( 100 );
4272 mSeedSpinBox->setShowClearButton(
true );
4273 mSeedSpinBox->setClearValue( 0 );
4275 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
4276 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
4277 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
4278 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
4279 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
4296 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
4306 bool showDensityBasedCountWidgets =
false;
4310 showDensityBasedCountWidgets =
true;
4315 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4316 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4317 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4318 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4322 mDensityAreaUnitWidget->blockSignals(
true );
4325 mDensityAreaUnitWidget->blockSignals(
false );
4338 void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
4341 bool showDensityBasedCountWidgets =
false;
4345 showDensityBasedCountWidgets =
true;
4350 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4351 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4352 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4353 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4362 void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
4371 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
4380 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
4390 void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
static const double UI_SCALE_FACTOR
UI scaling factor.
void sourceChanged(const QString &source)
Emitted whenever the file source is changed in the widget.
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 QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
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_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)
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
Set stroke color.
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
Gets stroke color.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point.
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
void setStrokeWidth(double width)
Set's the marker's stroke width.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
QgsFontMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
QString character() const
Returns the character(s) used when rendering points.
static QString translateNamedStyle(const QString &namedStyle)
Returns the localized named style of a font, if such a translation is available.
static QString untranslateNamedStyle(const QString &namedStyle)
Returns the english named style of a font, if possible.
static bool updateFontViaStyle(QFont &f, const QString &fontstyle, bool fallback=false)
Updates font with named style and retain all font properties.
QString geometryExpression() const
Gets the expression to generate this geometry.
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
QgsSymbol::SymbolType symbolType() const
Access the symbol type.
void setSymbolType(QgsSymbol::SymbolType symbolType)
Set the type of symbol which should be created.
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient fill.
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient. Controls how the gradient stops are positioned.
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
void setGradientType(GradientType gradientType)
void setCoordinateMode(GradientCoordinateMode coordinateMode)
GradientSpread gradientSpread() const
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
bool referencePoint2IsCentroid() const
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
void setGradientColorType(GradientColorType gradientColorType)
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
void setGradientSpread(GradientSpread gradientSpread)
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
QPointF referencePoint1() const
void setReferencePoint1(QPointF referencePoint)
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.
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
GradientType gradientType() const
Type of gradient, e.g., linear or radial.
bool referencePoint1IsCentroid() const
QPointF referencePoint2() const
void setColor2(const QColor &color2)
Line symbol layer type which draws repeating line sections along a line feature.
void setHashLength(double length)
Sets the length of hash symbols.
double hashAngle() const
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
double hashLength() const
Returns the length of hash symbols.
void setHashAngle(double angle)
Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false, bool *isMissing=nullptr)
Returns the specified path rendered as an image.
static QIcon iconPolygon()
A symbol fill consisting of repeated parallel lines.
void setMapUnitScale(const QgsMapUnitScale &scale) override
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern's offset.
double distance() const
Returns the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
@ ExteriorRingOnly
Render the exterior ring only.
@ InteriorRingsOnly
Render the interior rings only.
@ AllRings
Render both exterior and interior rings.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line's offset.
void setOffset(double offset)
Sets the line's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
virtual double width() const
Returns the estimated width for the line symbol layer.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
double offset() const
Returns the line's offset.
const QgsMapUnitScale & widthMapUnitScale() const
A line symbol type, for rendering LineString and MultiLineString geometries.
Line symbol layer type which draws repeating marker symbols along a line feature.
virtual void setSize(double size)
Sets the symbol size.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setAngle(double angle)
Sets the rotation angle for the marker.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
double size() const
Returns the symbol size.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
VerticalAnchorPoint
Symbol vertical anchor points.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
A marker symbol type, for rendering Point and MultiPoint geometries.
A dialog to create a new auxiliary field.
A dialog to create a new auxiliary layer.
void setDisplacementX(double d)
const QgsMapUnitScale & displacementYMapUnitScale() const
void setOffsetYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
void setOffsetX(double offset)
Sets the horizontal offset values for points in the pattern.
QgsUnitTypes::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
double displacementY() const
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows in the pattern.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
double offsetY() const
Returns the vertical offset values for points in the pattern.
void setDisplacementY(double d)
const QgsMapUnitScale & distanceYMapUnitScale() const
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
QgsUnitTypes::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
void setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal distance between points in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal offset for rows in the pattern.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setDistanceY(double d)
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setDistanceX(double d)
double offsetX() const
Returns the horizontal offset values for 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)
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
double displacementX() const
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
void setOffsetXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical distance between points in the pattern.
const QgsMapUnitScale & displacementXMapUnitScale() const
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 setCountMethod(CountMethod method)
Sets the count method used to randomly fill the polygon.
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.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
void setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
void setPointCount(int count)
Sets the count of random points to render in the fill.
CountMethod
Methods to define the number of points randomly filling the polygon.
@ AbsoluteCount
The point count is used as an absolute count of markers.
@ DensityBasedCount
The point count is part of a marker density count.
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.
CountMethod countMethod() const
Returns the count method used 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.
@ Feature
Tiling is based on feature bounding box.
@ Viewport
Tiling is based on complete map viewport.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image's width.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
double opacity() const
Returns the opacity for the raster image used in the fill.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QString imageFilePath() const
The path to the raster image used for the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
void setCoordinateMode(FillCoordinateMode mode)
Set the coordinate mode for fill.
QPointF offset() const
Returns the offset for the fill.
void setOffset(QPointF offset)
Sets the offset for the fill.
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
Raster marker symbol layer class.
void setOpacity(double opacity)
Set the marker opacity.
QString path() const
Returns the marker raster image path.
void setPath(const QString &path)
Set the marker raster image path.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
double opacity() const
Returns the marker opacity.
A class for filling symbols with a repeated SVG file.
void setParameters(const QMap< QString, QgsProperty > ¶meters)
Sets the dynamic SVG parameters.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
void setSvgFilePath(const QString &svgPath)
Sets the path to the SVG file to render in the fill.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the stroke width.
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
const QgsMapUnitScale & distanceMapUnitScale() const
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
const QgsMapUnitScale & offsetMapUnitScale() const
void setColorType(ShapeburstColorType colorType)
Sets the color mode to use for 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.
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
Qt::PenJoinStyle penJoinStyle() const
QColor strokeColor() const override
Gets stroke color.
void setBrushStyle(Qt::BrushStyle style)
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
void setPenJoinStyle(Qt::PenJoinStyle style)
Qt::PenStyle strokeStyle() const
double strokeWidth() const
void setStrokeWidth(double strokeWidth)
void setStrokeStyle(Qt::PenStyle strokeStyle)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QPointF offset()
Returns the offset by which polygons will be translated during rendering.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setStrokeColor(const QColor &strokeColor) override
Set stroke color.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the fill's offset.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill's stroke.
Qt::BrushStyle brushStyle() const
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
QgsUnitTypes::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
bool tweakDashPatternOnCorners() const
Returns true if dash patterns tweaks should be applied on sharp corners, to ensure that a double-leng...
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
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.
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.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
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 ...
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
const QgsMapUnitScale & dashPatternOffsetMapUnitScale() const
Returns the map unit scale the dash pattern offset value.
void setDashPatternOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the dash pattern offset.
QgsSimpleLineSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
double dashPatternOffset() const
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should sta...
void setAlignDashPattern(bool enabled)
Sets whether dash patterns should be aligned to the start and end of lines, by applying subtle tweaks...
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
void setMapUnitScale(const QgsMapUnitScale &scale) override
bool alignDashPattern() const
Returns true if dash patterns should be aligned to the start and end of lines, by applying subtle twe...
static bool shapeIsFilled(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Returns true if a symbol shape has a fill.
static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes()
Returns a list of all available shape types.
QgsSimpleMarkerSymbolLayerBase::Shape shape() const
Returns the shape for the rendered marker symbol.
void setShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Sets the rendered marker shape.
static QString encodeShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Encodes a shape to its string representation.
Shape
Marker symbol shapes.
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
The fill color.
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.
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
Gets fill color.
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)
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
Gets fill color.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
QString path() const
Returns the marker SVG path.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
void setStrokeWidth(double w)
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
void setStrokeColor(const QColor &c) override
Set stroke color.
void setMapUnitScale(const QgsMapUnitScale &scale) override
QColor strokeColor() const override
Gets stroke color.
void setFillColor(const QColor &color) override
Set fill color.
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.
void sourceChanged(const QString &source)
Emitted whenever the SVG source is changed in the widget.
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *shape=nullptr)
Returns a pixmap preview for a color ramp.
static QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0, QgsLegendPatchShape *shape=nullptr)
Returns an icon preview for a color ramp.
static QIcon symbolLayerPreviewIcon(const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
Draws a symbol layer preview to an icon.
Property
Data definable properties.
@ PropertyGradientReference1X
Gradient reference point 1 x.
@ PropertyShapeburstIgnoreRings
Shapeburst ignore rings.
@ PropertyGradientReference2X
Gradient reference point 2 x.
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
@ PropertyPlacement
Line marker placement.
@ PropertyHorizontalAnchor
Horizontal anchor point.
@ PropertyDistanceX
Horizontal distance between points.
@ PropertyFile
Filename, eg for svg files.
@ PropertyGradientType
Gradient fill type.
@ PropertyCapStyle
Line cap style.
@ PropertyAngle
Symbol angle.
@ 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.
@ 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.
@ PropertyOpacity
Opacity.
@ PropertySecondaryColor
Secondary color (eg for gradient fills)
@ PropertyCharacter
Character, eg for font marker symbol layers.
@ PropertyCoordinateMode
Gradient coordinate mode.
@ PropertyLineAngle
Line angle, or angle of hash lines for hash line symbols.
@ PropertyShapeburstMaxDistance
Shapeburst fill from edge distance.
@ 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.
@ PropertyFillStyle
Fill style (eg solid, dots)
@ PropertyDisplacementY
Vertical displacement.
@ PropertyStrokeColor
Stroke color.
@ PropertyGradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ PropertyWidth
Symbol width.
virtual QColor color() const
The fill color.
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.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
virtual void setColor(const QColor &color)
The fill color.
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.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
QgsSymbol::SymbolType symbolType() const
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol...
SymbolType
Type of the symbol.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
void setMapUnitScale(const QgsMapUnitScale &scale) FINAL
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
Placement placement() const
Returns the placement of the symbols.
@ Vertex
Place symbols on every vertex in the line.
@ LastVertex
Place symbols on the last vertex in the line.
@ CentralPoint
Place symbols at the mid point of the line.
@ FirstVertex
Place symbols on the first vertex in the line.
@ SegmentCenter
Place symbols at the center of every line segment.
@ Interval
Place symbols at regular intervals.
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
double interval() const
Returns the interval between individual symbols.
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
void setPlacement(Placement placement)
Sets the placement of the symbols.
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setInterval(double interval)
Sets the interval between individual symbols.
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols.
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual symbo...
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
@ RenderMetersInMapUnits
Meters value as Map units.
@ RenderPercentage
Percentage of another measurement (e.g., canvas size, feature size)
@ RenderPoints
Points (e.g., for font sizes)
@ RenderMillimeters
Millimeters.
@ RenderMapUnits
Map units.
Represents a vector layer which manages a vector based data sets.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsSymbolLayer * > QgsSymbolLayerList
Single variable definition for use within a QgsExpressionContextScope.