45 #include <QAbstractButton> 46 #include <QButtonGroup> 47 #include <QColorDialog> 50 #include <QFileDialog> 52 #include <QStandardItemModel> 53 #include <QSvgRenderer> 54 #include <QMessageBox> 57 #include <QInputDialog> 73 expContext << symbolScope;
86 expContext.setOriginalValueVariable( QVariant() );
106 if ( ddButton->assistant() )
107 ddButton->assistant()->setMapCanvas( mContext.
mapCanvas() );
126 void QgsSymbolLayerWidget::createAuxiliaryField()
147 if ( dlg.exec() == QDialog::Accepted )
158 property.setActive(
true );
180 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
181 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
185 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
193 btnChangeColor->setAllowOpacity(
true );
194 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
195 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
200 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
204 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
209 spinOffset->setClearValue( 0.0 );
214 mDrawInsideCheckBox->hide();
215 mRingFilterComboBox->hide();
223 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
225 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
227 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
228 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
229 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
230 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
237 void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
239 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
241 mAssistantPreviewSymbol->deleteSymbolLayer( i );
243 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
246 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
252 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
259 mPenWidthUnitWidget->blockSignals(
true );
262 mPenWidthUnitWidget->blockSignals(
false );
263 mOffsetUnitWidget->blockSignals(
true );
266 mOffsetUnitWidget->blockSignals(
false );
267 mDashPatternUnitWidget->blockSignals(
true );
271 mDashPatternUnitWidget->blockSignals(
false );
274 spinWidth->blockSignals(
true );
276 spinWidth->blockSignals(
false );
277 btnChangeColor->blockSignals(
true );
279 btnChangeColor->blockSignals(
false );
280 spinOffset->blockSignals(
true );
282 spinOffset->blockSignals(
false );
283 cboPenStyle->blockSignals(
true );
284 cboJoinStyle->blockSignals(
true );
285 cboCapStyle->blockSignals(
true );
289 cboPenStyle->blockSignals(
false );
290 cboJoinStyle->blockSignals(
false );
291 cboCapStyle->blockSignals(
false );
295 mChangePatternButton->setEnabled( useCustomDashPattern );
296 label_3->setEnabled( !useCustomDashPattern );
297 cboPenStyle->setEnabled( !useCustomDashPattern );
298 mCustomCheckBox->blockSignals(
true );
299 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
300 mCustomCheckBox->blockSignals(
false );
304 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
318 updateAssistantSymbol();
326 void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
333 void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
340 void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
348 void QgsSimpleLineSymbolLayerWidget::offsetChanged()
355 void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
357 bool checked = ( state == Qt::Checked );
358 mChangePatternButton->setEnabled( checked );
359 label_3->setEnabled( !checked );
360 cboPenStyle->setEnabled( !checked );
366 void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
369 if ( d.exec() == QDialog::Accepted )
377 void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
387 void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
397 void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
407 void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
409 bool checked = ( state == Qt::Checked );
428 mChangePatternButton->setIcon( buttonIcon );
445 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
446 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
447 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
448 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
456 btnChangeColorFill->setAllowOpacity(
true );
457 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
458 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
459 btnChangeColorFill->setShowNoColor(
true );
460 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
461 btnChangeColorStroke->setAllowOpacity(
true );
462 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
463 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
464 btnChangeColorStroke->setShowNoColor(
true );
465 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
467 spinOffsetX->setClearValue( 0.0 );
468 spinOffsetY->setClearValue( 0.0 );
469 spinAngle->setClearValue( 0.0 );
475 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
477 int size = lstNames->iconSize().width();
478 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXX" ) ) ) ) );
479 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
480 lstNames->setIconSize( QSize( size, size ) );
482 double markerSize = size * 0.8;
487 lyr->
setColor( QColor( 200, 200, 200 ) );
490 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
491 item->setData( Qt::UserRole, static_cast< int >( shape ) );
496 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
498 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
501 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
502 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
503 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
504 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
505 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
511 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
519 for (
int i = 0; i < lstNames->count(); ++i )
521 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
523 lstNames->setCurrentRow( i );
527 btnChangeColorStroke->blockSignals(
true );
529 btnChangeColorStroke->blockSignals(
false );
530 btnChangeColorFill->blockSignals(
true );
533 btnChangeColorFill->blockSignals(
false );
534 spinSize->blockSignals(
true );
536 spinSize->blockSignals(
false );
537 spinAngle->blockSignals(
true );
539 spinAngle->blockSignals(
false );
540 mStrokeStyleComboBox->blockSignals(
true );
542 mStrokeStyleComboBox->blockSignals(
false );
543 mStrokeWidthSpinBox->blockSignals(
true );
545 mStrokeWidthSpinBox->blockSignals(
false );
546 cboJoinStyle->blockSignals(
true );
548 cboJoinStyle->blockSignals(
false );
551 spinOffsetX->blockSignals(
true );
553 spinOffsetX->blockSignals(
false );
554 spinOffsetY->blockSignals(
true );
556 spinOffsetY->blockSignals(
false );
558 mSizeUnitWidget->blockSignals(
true );
561 mSizeUnitWidget->blockSignals(
false );
562 mOffsetUnitWidget->blockSignals(
true );
565 mOffsetUnitWidget->blockSignals(
false );
566 mStrokeWidthUnitWidget->blockSignals(
true );
569 mStrokeWidthUnitWidget->blockSignals(
false );
572 mHorizontalAnchorComboBox->blockSignals(
true );
573 mVerticalAnchorComboBox->blockSignals(
true );
576 mHorizontalAnchorComboBox->blockSignals(
false );
577 mVerticalAnchorComboBox->blockSignals(
false );
591 updateAssistantSymbol();
599 void QgsSimpleMarkerSymbolLayerWidget::setShape()
601 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
618 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
624 void QgsSimpleMarkerSymbolLayerWidget::setSize()
630 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
636 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
638 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
642 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
653 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
662 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
672 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
682 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
692 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
701 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
710 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
712 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
714 mAssistantPreviewSymbol->deleteSymbolLayer( i );
716 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
719 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
738 btnChangeColor->setAllowOpacity(
true );
739 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
740 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
741 btnChangeColor->setShowNoColor(
true );
742 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
743 btnChangeStrokeColor->setAllowOpacity(
true );
744 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
745 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
746 btnChangeStrokeColor->setShowNoColor(
true );
747 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
749 spinOffsetX->setClearValue( 0.0 );
750 spinOffsetY->setClearValue( 0.0 );
753 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
755 connect( spinStrokeWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
756 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
757 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
758 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
759 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
764 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
771 btnChangeColor->blockSignals(
true );
773 btnChangeColor->blockSignals(
false );
774 cboFillStyle->blockSignals(
true );
776 cboFillStyle->blockSignals(
false );
777 btnChangeStrokeColor->blockSignals(
true );
779 btnChangeStrokeColor->blockSignals(
false );
780 cboStrokeStyle->blockSignals(
true );
782 cboStrokeStyle->blockSignals(
false );
783 spinStrokeWidth->blockSignals(
true );
785 spinStrokeWidth->blockSignals(
false );
786 cboJoinStyle->blockSignals(
true );
788 cboJoinStyle->blockSignals(
false );
789 spinOffsetX->blockSignals(
true );
791 spinOffsetX->blockSignals(
false );
792 spinOffsetY->blockSignals(
true );
794 spinOffsetY->blockSignals(
false );
796 mStrokeWidthUnitWidget->blockSignals(
true );
799 mStrokeWidthUnitWidget->blockSignals(
false );
800 mOffsetUnitWidget->blockSignals(
true );
803 mOffsetUnitWidget->blockSignals(
false );
831 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
837 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
843 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
850 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
852 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
856 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
866 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
886 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
887 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
893 spinOffsetX->setClearValue( 0.0 );
894 spinOffsetY->setClearValue( 0.0 );
895 spinAngle->setClearValue( 0.0 );
901 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
903 int size = lstNames->iconSize().width();
904 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXX" ) ) ) ) );
905 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
906 lstNames->setIconSize( QSize( size, size ) );
908 double markerSize = size * 0.8;
914 lyr->
setColor( QColor( 200, 200, 200 ) );
917 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
918 item->setData( Qt::UserRole, static_cast< int >( shape ) );
923 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
925 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
926 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
927 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
928 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
929 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
935 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
943 for (
int i = 0; i < lstNames->count(); ++i )
945 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
947 lstNames->setCurrentRow( i );
956 mSizeUnitWidget->blockSignals(
true );
959 mSizeUnitWidget->blockSignals(
false );
960 mOffsetUnitWidget->blockSignals(
true );
963 mOffsetUnitWidget->blockSignals(
false );
976 updateAssistantSymbol();
984 void QgsFilledMarkerSymbolLayerWidget::setShape()
986 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
990 void QgsFilledMarkerSymbolLayerWidget::setSize()
996 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1002 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1004 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1008 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1018 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1028 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1037 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1046 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1048 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1050 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1052 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1055 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1068 connect( mSpinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1072 btnColorRamp->setShowGradientOnly(
true );
1074 btnChangeColor->setAllowOpacity(
true );
1075 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1076 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1077 btnChangeColor->setShowNoColor(
true );
1078 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1079 btnChangeColor2->setAllowOpacity(
true );
1080 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1081 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1082 btnChangeColor2->setShowNoColor(
true );
1083 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1085 spinOffsetX->setClearValue( 0.0 );
1086 spinOffsetY->setClearValue( 0.0 );
1087 mSpinAngle->setClearValue( 0.0 );
1095 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1096 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1097 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1098 connect( spinRefPoint1X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1099 connect( spinRefPoint1Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1100 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1101 connect( spinRefPoint2X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1102 connect( spinRefPoint2Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1103 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1108 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1115 btnChangeColor->blockSignals(
true );
1117 btnChangeColor->blockSignals(
false );
1118 btnChangeColor2->blockSignals(
true );
1120 btnChangeColor2->blockSignals(
false );
1124 radioTwoColor->setChecked(
true );
1125 btnColorRamp->setEnabled(
false );
1129 radioColorRamp->setChecked(
true );
1130 btnChangeColor->setEnabled(
false );
1131 btnChangeColor2->setEnabled(
false );
1137 btnColorRamp->blockSignals(
true );
1139 btnColorRamp->blockSignals(
false );
1142 cboGradientType->blockSignals(
true );
1146 cboGradientType->setCurrentIndex( 0 );
1149 cboGradientType->setCurrentIndex( 1 );
1152 cboGradientType->setCurrentIndex( 2 );
1155 cboGradientType->blockSignals(
false );
1157 cboCoordinateMode->blockSignals(
true );
1161 cboCoordinateMode->setCurrentIndex( 1 );
1162 checkRefPoint1Centroid->setEnabled(
false );
1163 checkRefPoint2Centroid->setEnabled(
false );
1167 cboCoordinateMode->setCurrentIndex( 0 );
1170 cboCoordinateMode->blockSignals(
false );
1172 cboGradientSpread->blockSignals(
true );
1176 cboGradientSpread->setCurrentIndex( 0 );
1179 cboGradientSpread->setCurrentIndex( 1 );
1182 cboGradientSpread->setCurrentIndex( 2 );
1185 cboGradientSpread->blockSignals(
false );
1187 spinRefPoint1X->blockSignals(
true );
1189 spinRefPoint1X->blockSignals(
false );
1190 spinRefPoint1Y->blockSignals(
true );
1192 spinRefPoint1Y->blockSignals(
false );
1193 checkRefPoint1Centroid->blockSignals(
true );
1197 spinRefPoint1X->setEnabled(
false );
1198 spinRefPoint1Y->setEnabled(
false );
1200 checkRefPoint1Centroid->blockSignals(
false );
1201 spinRefPoint2X->blockSignals(
true );
1203 spinRefPoint2X->blockSignals(
false );
1204 spinRefPoint2Y->blockSignals(
true );
1206 spinRefPoint2Y->blockSignals(
false );
1207 checkRefPoint2Centroid->blockSignals(
true );
1211 spinRefPoint2X->setEnabled(
false );
1212 spinRefPoint2Y->setEnabled(
false );
1214 checkRefPoint2Centroid->blockSignals(
false );
1216 spinOffsetX->blockSignals(
true );
1218 spinOffsetX->blockSignals(
false );
1219 spinOffsetY->blockSignals(
true );
1221 spinOffsetY->blockSignals(
false );
1222 mSpinAngle->blockSignals(
true );
1224 mSpinAngle->blockSignals(
false );
1226 mOffsetUnitWidget->blockSignals(
true );
1229 mOffsetUnitWidget->blockSignals(
false );
1262 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1264 if ( radioTwoColor->isChecked() )
1277 if ( btnColorRamp->isNull() )
1291 spinRefPoint1X->setValue( 0.5 );
1292 spinRefPoint1Y->setValue( 0 );
1293 spinRefPoint2X->setValue( 0.5 );
1294 spinRefPoint2Y->setValue( 1 );
1299 spinRefPoint1X->setValue( 0 );
1300 spinRefPoint1Y->setValue( 0 );
1301 spinRefPoint2X->setValue( 1 );
1302 spinRefPoint2Y->setValue( 1 );
1306 spinRefPoint1X->setValue( 0.5 );
1307 spinRefPoint1Y->setValue( 0.5 );
1308 spinRefPoint2X->setValue( 1 );
1309 spinRefPoint2Y->setValue( 1 );
1324 checkRefPoint1Centroid->setEnabled(
true );
1325 checkRefPoint2Centroid->setEnabled(
true );
1331 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1332 checkRefPoint1Centroid->setEnabled(
false );
1333 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1334 checkRefPoint2Centroid->setEnabled(
false );
1359 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1361 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1365 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1374 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1380 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1398 connect( mSpinBlurRadius, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1399 connect( mSpinMaxDistance, qgis::overload< double >::of( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1401 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1403 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1409 QButtonGroup *group1 =
new QButtonGroup(
this );
1410 group1->addButton( radioColorRamp );
1411 group1->addButton( radioTwoColor );
1412 QButtonGroup *group2 =
new QButtonGroup(
this );
1413 group2->addButton( mRadioUseMaxDistance );
1414 group2->addButton( mRadioUseWholeShape );
1415 btnChangeColor->setAllowOpacity(
true );
1416 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1417 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1418 btnChangeColor->setShowNoColor(
true );
1419 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1420 btnChangeColor2->setAllowOpacity(
true );
1421 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1422 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1423 btnChangeColor2->setShowNoColor(
true );
1424 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1426 spinOffsetX->setClearValue( 0.0 );
1427 spinOffsetY->setClearValue( 0.0 );
1429 btnColorRamp->setShowGradientOnly(
true );
1435 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1436 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1437 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1439 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1440 connect( mSpinBlurRadius, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1445 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1452 btnChangeColor->blockSignals(
true );
1454 btnChangeColor->blockSignals(
false );
1455 btnChangeColor2->blockSignals(
true );
1457 btnChangeColor2->blockSignals(
false );
1461 radioTwoColor->setChecked(
true );
1462 btnColorRamp->setEnabled(
false );
1466 radioColorRamp->setChecked(
true );
1467 btnChangeColor->setEnabled(
false );
1468 btnChangeColor2->setEnabled(
false );
1471 mSpinBlurRadius->blockSignals(
true );
1472 mBlurSlider->blockSignals(
true );
1475 mSpinBlurRadius->blockSignals(
false );
1476 mBlurSlider->blockSignals(
false );
1478 mSpinMaxDistance->blockSignals(
true );
1480 mSpinMaxDistance->blockSignals(
false );
1482 mRadioUseWholeShape->blockSignals(
true );
1483 mRadioUseMaxDistance->blockSignals(
true );
1486 mRadioUseWholeShape->setChecked(
true );
1487 mSpinMaxDistance->setEnabled(
false );
1488 mDistanceUnitWidget->setEnabled(
false );
1492 mRadioUseMaxDistance->setChecked(
true );
1493 mSpinMaxDistance->setEnabled(
true );
1494 mDistanceUnitWidget->setEnabled(
true );
1496 mRadioUseWholeShape->blockSignals(
false );
1497 mRadioUseMaxDistance->blockSignals(
false );
1499 mDistanceUnitWidget->blockSignals(
true );
1502 mDistanceUnitWidget->blockSignals(
false );
1504 mIgnoreRingsCheckBox->blockSignals(
true );
1505 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1506 mIgnoreRingsCheckBox->blockSignals(
false );
1511 btnColorRamp->blockSignals(
true );
1513 btnColorRamp->blockSignals(
false );
1516 spinOffsetX->blockSignals(
true );
1518 spinOffsetX->blockSignals(
false );
1519 spinOffsetY->blockSignals(
true );
1521 spinOffsetY->blockSignals(
false );
1522 mOffsetUnitWidget->blockSignals(
true );
1525 mOffsetUnitWidget->blockSignals(
false );
1558 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1565 if ( radioTwoColor->isChecked() )
1576 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1585 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1594 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1604 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1609 mDistanceUnitWidget->setEnabled( !value );
1614 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1624 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1628 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1633 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1644 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1646 bool checked = ( state == Qt::Checked );
1672 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1676 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
1681 spinOffset->setClearValue( 0.0 );
1686 mRingFilterComboBox->hide();
1687 mRingsLabel->hide();
1692 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1693 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1694 connect( radInterval, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1695 connect( radVertex, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1696 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1697 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1698 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1699 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1704 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1711 spinInterval->blockSignals(
true );
1713 spinInterval->blockSignals(
false );
1714 mSpinOffsetAlongLine->blockSignals(
true );
1716 mSpinOffsetAlongLine->blockSignals(
false );
1717 chkRotateMarker->blockSignals(
true );
1719 chkRotateMarker->blockSignals(
false );
1720 spinOffset->blockSignals(
true );
1722 spinOffset->blockSignals(
false );
1724 radInterval->setChecked(
true );
1726 radVertex->setChecked(
true );
1728 radVertexLast->setChecked(
true );
1730 radCentralPoint->setChecked(
true );
1732 radCurvePoint->setChecked(
true );
1734 radVertexFirst->setChecked(
true );
1737 mIntervalUnitWidget->blockSignals(
true );
1740 mIntervalUnitWidget->blockSignals(
false );
1741 mOffsetUnitWidget->blockSignals(
true );
1744 mOffsetUnitWidget->blockSignals(
false );
1745 mOffsetAlongLineUnitWidget->blockSignals(
true );
1748 mOffsetAlongLineUnitWidget->blockSignals(
false );
1777 void QgsMarkerLineSymbolLayerWidget::setRotate()
1783 void QgsMarkerLineSymbolLayerWidget::setOffset()
1789 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1791 bool interval = radInterval->isChecked();
1792 spinInterval->setEnabled( interval );
1793 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1795 if ( radInterval->isChecked() )
1797 else if ( radVertex->isChecked() )
1799 else if ( radVertexLast->isChecked() )
1801 else if ( radVertexFirst->isChecked() )
1803 else if ( radCurvePoint->isChecked() )
1811 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
1821 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
1831 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
1851 mSvgSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
1855 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
1856 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
1860 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
1861 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
1868 viewGroups->setHeaderHidden(
true );
1869 mChangeColorButton->setAllowOpacity(
true );
1870 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
1871 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
1872 mChangeStrokeColorButton->setAllowOpacity(
true );
1873 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
1874 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
1876 spinOffsetX->setClearValue( 0.0 );
1877 spinOffsetY->setClearValue( 0.0 );
1878 spinAngle->setClearValue( 0.0 );
1880 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXXX" ) ) ) ) );
1881 viewImages->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
1885 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
1886 connect( viewGroups->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::populateIcons );
1887 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
1888 connect( spinHeight, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
1890 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
1891 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
1892 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
1901 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
1902 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
1907 #include <QAbstractListModel> 1908 #include <QPixmapCache> 1914 QAbstractItemModel *oldModel = viewGroups->model();
1916 viewGroups->setModel( g );
1920 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
1921 for (
int i = 0; i < rows; i++ )
1923 viewGroups->setExpanded( g->indexFromItem( g->item( i ) ),
true );
1927 oldModel = viewImages->model();
1929 viewImages->setModel( m );
1933 void QgsSvgMarkerSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
1935 QString path = idx.data( Qt::UserRole + 1 ).toString();
1937 QAbstractItemModel *oldModel = viewImages->model();
1939 viewImages->setModel( m );
1942 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
1953 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
1954 QColor defaultFill, defaultStroke;
1955 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
1956 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
1958 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
1959 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
1960 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
1961 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
1962 mChangeColorButton->setEnabled( hasFillParam );
1963 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
1964 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
1965 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
1966 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
1971 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
1972 if ( hasDefaultFillColor )
1976 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
1977 mChangeColorButton->setColor( fill );
1979 if ( hasStrokeParam )
1982 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
1983 if ( hasDefaultStrokeColor )
1985 stroke = defaultStroke;
1987 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
1988 mChangeStrokeColorButton->setColor( stroke );
1993 mStrokeWidthSpinBox->blockSignals(
true );
1994 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
1995 mStrokeWidthSpinBox->blockSignals(
false );
1998 spinHeight->blockSignals(
true );
1999 if ( preservedAspectRatio )
2001 spinHeight->setValue( layer->
size() );
2008 spinHeight->blockSignals(
false );
2009 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2012 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2014 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2016 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2018 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2021 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2032 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2040 QAbstractItemModel *m = viewImages->model();
2041 QItemSelectionModel *selModel = viewImages->selectionModel();
2042 for (
int i = 0; i < m->rowCount(); i++ )
2044 QModelIndex idx( m->index( i, 0 ) );
2045 if ( m->data( idx ).toString() ==
mLayer->
path() )
2047 selModel->select( idx, QItemSelectionModel::SelectCurrent );
2048 selModel->setCurrentIndex( idx, QItemSelectionModel::SelectCurrent );
2054 spinWidth->blockSignals(
true );
2056 spinWidth->blockSignals(
false );
2057 spinAngle->blockSignals(
true );
2059 spinAngle->blockSignals(
false );
2062 spinOffsetX->blockSignals(
true );
2064 spinOffsetX->blockSignals(
false );
2065 spinOffsetY->blockSignals(
true );
2067 spinOffsetY->blockSignals(
false );
2069 mSizeUnitWidget->blockSignals(
true );
2072 mSizeUnitWidget->blockSignals(
false );
2073 mStrokeWidthUnitWidget->blockSignals(
true );
2076 mStrokeWidthUnitWidget->blockSignals(
false );
2077 mOffsetUnitWidget->blockSignals(
true );
2080 mOffsetUnitWidget->blockSignals(
false );
2083 mHorizontalAnchorComboBox->blockSignals(
true );
2084 mVerticalAnchorComboBox->blockSignals(
true );
2087 mHorizontalAnchorComboBox->blockSignals(
false );
2088 mVerticalAnchorComboBox->blockSignals(
false );
2103 updateAssistantSymbol();
2111 void QgsSvgMarkerSymbolLayerWidget::setName(
const QModelIndex &idx )
2113 QString name = idx.data( Qt::UserRole ).toString();
2121 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2124 double fixedAspectRatio = 0.0;
2125 spinHeight->blockSignals(
true );
2126 if ( defaultAspectRatio <= 0.0 )
2128 spinHeight->setValue( spinWidth->value() );
2130 else if ( mLockAspectRatio->locked() )
2132 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2136 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2138 spinHeight->blockSignals(
false );
2144 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2147 double fixedAspectRatio = 0.0;
2148 spinWidth->blockSignals(
true );
2149 if ( defaultAspectRatio <= 0.0 )
2151 spinWidth->setValue( spinHeight->value() );
2153 else if ( mLockAspectRatio->locked() )
2155 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2159 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2161 spinWidth->blockSignals(
false );
2167 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2171 if ( defaultAspectRatio <= 0.0 )
2187 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2193 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2195 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2199 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2206 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2217 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2228 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2237 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2247 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2257 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2267 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2276 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2291 connect( mTextureWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2293 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2295 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2296 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2303 mSvgTreeView->setHeaderHidden(
true );
2306 mRotationSpinBox->setClearValue( 0.0 );
2308 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2309 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2310 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2311 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2313 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2314 connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::populateIcons );
2324 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2333 mTextureWidthSpinBox->blockSignals(
true );
2334 mTextureWidthSpinBox->setValue( width );
2335 mTextureWidthSpinBox->blockSignals(
false );
2337 mRotationSpinBox->blockSignals(
true );
2339 mRotationSpinBox->blockSignals(
false );
2340 mTextureWidthUnitWidget->blockSignals(
true );
2343 mTextureWidthUnitWidget->blockSignals(
false );
2344 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2347 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2348 mChangeColorButton->blockSignals(
true );
2350 mChangeColorButton->blockSignals(
false );
2351 mChangeStrokeColorButton->blockSignals(
true );
2353 mChangeStrokeColorButton->blockSignals(
false );
2354 mStrokeWidthSpinBox->blockSignals(
true );
2356 mStrokeWidthSpinBox->blockSignals(
false );
2373 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2382 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2394 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex &item )
2396 QString file = item.data( Qt::UserRole ).toString();
2406 QAbstractItemModel *oldModel = mSvgTreeView->model();
2408 mSvgTreeView->setModel( g );
2412 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2413 for (
int i = 0; i < rows; i++ )
2415 mSvgTreeView->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2418 oldModel = mSvgListView->model();
2420 mSvgListView->setModel( m );
2424 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2426 QString path = idx.data( Qt::UserRole + 1 ).toString();
2428 QAbstractItemModel *oldModel = mSvgListView->model();
2430 mSvgListView->setModel( m );
2433 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2437 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2449 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2450 QColor defaultFill, defaultStroke;
2451 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2452 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2454 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2455 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2456 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2457 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2460 QColor fill = mChangeColorButton->color();
2461 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2462 if ( hasDefaultFillColor )
2466 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2467 mChangeColorButton->setColor( fill );
2469 mChangeColorButton->setEnabled( hasFillParam );
2470 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2473 QColor stroke = mChangeStrokeColorButton->color();
2474 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2475 if ( hasDefaultStrokeColor )
2477 stroke = defaultStroke;
2479 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2480 mChangeStrokeColorButton->setColor( stroke );
2482 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2483 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2484 if ( hasDefaultStrokeWidth && resetValues )
2486 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2488 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2491 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2502 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2513 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2522 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2532 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
2548 connect( mAngleSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
2549 connect( mDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
2550 connect( mOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
2557 mOffsetSpinBox->setClearValue( 0 );
2558 mAngleSpinBox->setClearValue( 0 );
2563 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
2572 mAngleSpinBox->blockSignals(
true );
2574 mAngleSpinBox->blockSignals(
false );
2575 mDistanceSpinBox->blockSignals(
true );
2577 mDistanceSpinBox->blockSignals(
false );
2578 mOffsetSpinBox->blockSignals(
true );
2580 mOffsetSpinBox->blockSignals(
false );
2583 mDistanceUnitWidget->blockSignals(
true );
2586 mDistanceUnitWidget->blockSignals(
false );
2587 mOffsetUnitWidget->blockSignals(
true );
2590 mOffsetUnitWidget->blockSignals(
false );
2602 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
2611 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
2620 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
2629 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
2639 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
2655 connect( mHorizontalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
2656 connect( mVerticalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
2657 connect( mHorizontalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
2658 connect( mVerticalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
2659 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
2660 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
2661 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
2662 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
2676 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
2682 mHorizontalDistanceSpinBox->blockSignals(
true );
2684 mHorizontalDistanceSpinBox->blockSignals(
false );
2685 mVerticalDistanceSpinBox->blockSignals(
true );
2687 mVerticalDistanceSpinBox->blockSignals(
false );
2688 mHorizontalDisplacementSpinBox->blockSignals(
true );
2690 mHorizontalDisplacementSpinBox->blockSignals(
false );
2691 mVerticalDisplacementSpinBox->blockSignals(
true );
2693 mVerticalDisplacementSpinBox->blockSignals(
false );
2695 mHorizontalDistanceUnitWidget->blockSignals(
true );
2698 mHorizontalDistanceUnitWidget->blockSignals(
false );
2699 mVerticalDistanceUnitWidget->blockSignals(
true );
2702 mVerticalDistanceUnitWidget->blockSignals(
false );
2703 mHorizontalDisplacementUnitWidget->blockSignals(
true );
2706 mHorizontalDisplacementUnitWidget->blockSignals(
false );
2707 mVerticalDisplacementUnitWidget->blockSignals(
true );
2710 mVerticalDisplacementUnitWidget->blockSignals(
false );
2723 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
2732 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
2741 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
2750 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
2759 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
2769 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
2779 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
2789 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
2810 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2811 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2812 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2822 btnColor->setAllowOpacity(
true );
2823 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
2824 btnColor->setContext( QStringLiteral(
"symbology" ) );
2825 btnStrokeColor->setAllowOpacity(
true );
2826 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
2827 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
2829 spinOffsetX->setClearValue( 0.0 );
2830 spinOffsetY->setClearValue( 0.0 );
2831 spinAngle->setClearValue( 0.0 );
2837 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
2841 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
2844 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
2846 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
2847 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
2854 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
2878 mSizeUnitWidget->blockSignals(
true );
2881 mSizeUnitWidget->blockSignals(
false );
2883 mStrokeWidthUnitWidget->blockSignals(
true );
2886 mStrokeWidthUnitWidget->blockSignals(
false );
2888 mOffsetUnitWidget->blockSignals(
true );
2891 mOffsetUnitWidget->blockSignals(
false );
2910 updateAssistantSymbol();
2956 void QgsFontMarkerSymbolLayerWidget::setOffset()
2958 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2962 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
2968 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2978 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2988 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2998 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3007 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3016 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3025 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3027 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3029 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3031 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3034 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3046 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3047 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3052 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3068 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3074 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3087 connect( mBrowseToolButton, &QToolButton::clicked,
this, &QgsRasterFillSymbolLayerWidget::mBrowseToolButton_clicked );
3088 connect( mImageLineEdit, &QLineEdit::editingFinished,
this, &QgsRasterFillSymbolLayerWidget::mImageLineEdit_editingFinished );
3090 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
3092 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
3099 mSpinOffsetX->setClearValue( 0.0 );
3100 mSpinOffsetY->setClearValue( 0.0 );
3101 mRotationSpinBox->setClearValue( 0.0 );
3103 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
3104 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3105 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3117 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
3128 mImageLineEdit->blockSignals(
true );
3130 mImageLineEdit->blockSignals(
false );
3132 cboCoordinateMode->blockSignals(
true );
3136 cboCoordinateMode->setCurrentIndex( 1 );
3140 cboCoordinateMode->setCurrentIndex( 0 );
3143 cboCoordinateMode->blockSignals(
false );
3144 mOpacityWidget->blockSignals(
true );
3146 mOpacityWidget->blockSignals(
false );
3147 mRotationSpinBox->blockSignals(
true );
3149 mRotationSpinBox->blockSignals(
false );
3151 mSpinOffsetX->blockSignals(
true );
3153 mSpinOffsetX->blockSignals(
false );
3154 mSpinOffsetY->blockSignals(
true );
3156 mSpinOffsetY->blockSignals(
false );
3157 mOffsetUnitWidget->blockSignals(
true );
3160 mOffsetUnitWidget->blockSignals(
false );
3162 mWidthSpinBox->blockSignals(
true );
3164 mWidthSpinBox->blockSignals(
false );
3165 mWidthUnitWidget->blockSignals(
true );
3168 mWidthUnitWidget->blockSignals(
false );
3169 updatePreviewImage();
3182 void QgsRasterFillSymbolLayerWidget::mBrowseToolButton_clicked()
3186 QString lineEditText = mImageLineEdit->text();
3187 if ( !lineEditText.isEmpty() )
3189 QFileInfo openDirFileInfo( lineEditText );
3190 openDir = openDirFileInfo.path();
3193 if ( openDir.isEmpty() )
3195 openDir = s.
value( QStringLiteral(
"/UI/lastRasterFillImageDir" ), QDir::homePath() ).toString();
3199 QString filePath = QFileDialog::getOpenFileName(
nullptr, tr(
"Select Image File" ), openDir );
3200 if ( !filePath.isNull() )
3203 QFileInfo fileInfo( filePath );
3204 if ( !fileInfo.exists() || !fileInfo.isReadable() )
3206 QMessageBox::critical(
nullptr, QStringLiteral(
"Select Image File" ), QStringLiteral(
"Error, file does not exist or is not readable." ) );
3210 s.
setValue( QStringLiteral(
"/UI/lastRasterFillImageDir" ), fileInfo.absolutePath() );
3211 mImageLineEdit->setText( filePath );
3212 mImageLineEdit_editingFinished();
3216 void QgsRasterFillSymbolLayerWidget::mImageLineEdit_editingFinished()
3223 QFileInfo fi( mImageLineEdit->text() );
3226 QUrl url( mImageLineEdit->text() );
3227 if ( !url.isValid() )
3233 QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
3235 updatePreviewImage();
3236 QApplication::restoreOverrideCursor();
3241 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
3258 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
3267 updatePreviewImage();
3270 void QgsRasterFillSymbolLayerWidget::offsetChanged()
3272 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3276 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3287 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
3296 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
3307 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
3318 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
3326 if ( image.isNull() )
3328 mLabelImagePreview->setPixmap( QPixmap() );
3332 if ( image.height() > 150 || image.width() > 150 )
3334 image = image.scaled( 150, 150, Qt::KeepAspectRatio, Qt::SmoothTransformation );
3337 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3338 previewImage.fill( Qt::transparent );
3339 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3341 p.begin( &previewImage );
3343 uchar pixDataRGB[] = { 150, 150, 150, 150,
3348 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3349 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3350 QBrush checkerBrush;
3351 checkerBrush.setTexture( pix );
3352 p.fillRect( imageRect, checkerBrush );
3359 p.drawImage( imageRect.left(), imageRect.top(), image );
3361 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3370 modificationExpressionSelector->setMultiLine(
true );
3371 modificationExpressionSelector->setLayer( const_cast<QgsVectorLayer *>( vl ) );
3372 modificationExpressionSelector->registerExpressionContextGenerator(
this );
3377 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
3384 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
3392 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
3399 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
3401 mLayer->
setSymbolType( static_cast<QgsSymbol::SymbolType>( cbxGeometryType->currentData().toInt() ) );
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
bool rotateMarker() const
Shall the marker be rotated.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
static QgsSvgCache * svgCache()
Returns the application's SVG cache, used for caching SVG images and handling parameter replacement w...
static const QString EXPR_CLUSTER_COLOR
Inbuilt variable name for cluster color variable.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
Meters value as Map units.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
Single variable definition for use within a QgsExpressionContextScope.
Qt::PenJoinStyle penJoinStyle() const
Placement placement() const
The placement of the markers.
Gradient reference point 1 is centroid.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
void setMapUnitScale(const QgsMapUnitScale &scale) override
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used for the gradient fill.
const QgsMapUnitScale & displacementXMapUnitScale() const
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
Qt::PenStyle strokeStyle() const
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor strokeColor() const override
Gets stroke color.
QString geometryExpression() const
Gets the expression to generate this geometry.
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
Gradient reference point 1 x.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
Qt::BrushStyle brushStyle() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
void setUseCustomDashPattern(bool b)
A model for displaying SVG files with a preview icon.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
static const double UI_SCALE_FACTOR
UI scaling factor.
This class is a composition of two QSettings instances:
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker's stroke.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker's stroke style (e.g., solid, dashed, etc)
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke...
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
virtual void setWidth(double width)
QgsFontMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
A symbol fill consisting of repeated parallel lines.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
double displacementX() const
double interval() const
Returns the interval between individual markers.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
const QgsMapUnitScale & distanceMapUnitScale() const
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
double strokeWidth() const
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & intervalMapUnitScale() const
Render both exterior and interior rings.
void setAngle(double angle)
double size() const
Returns the symbol size.
Abstract base class for color ramps.
void setRotateMarker(bool rotate)
Shall the marker be rotated.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
const QgsMapUnitScale & offsetMapUnitScale() const
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
void setStrokeColor(const QColor &color) override
Sets the marker's stroke color.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
void setStrokeColor(const QColor &c) override
Set stroke color.
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
void setStrokeWidth(double width)
Set's the marker's stroke width.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0...
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Qt::PenStyle penStyle() const
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
QColor strokeColor() const override
Returns the marker's stroke color.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
const QgsMapUnitScale & widthMapUnitScale() const
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
double strokeWidth() const
double opacity() const
Returns the opacity for the raster image used in the fill.
static QString encodeShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Encodes a shape to its string representation.
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features...
Tiling is based on complete map viewport.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
Shapeburst use whole shape.
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)
A marker symbol type, for rendering Point and MultiPoint geometries.
Name, eg shape name for simple markers.
void setStrokeWidth(double strokeWidth)
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
A line symbol type, for rendering LineString and MultiLineString geometries.
Gradient reference point 2 y.
const QgsMapUnitScale & offsetMapUnitScale() const
static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes()
Returns a list of all available shape types.
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
QColor strokeColor() const override
Gets stroke color.
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
void setGradientType(GradientType gradientType)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
void setInterval(double interval)
Sets the interval between individual markers.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
static QIcon symbolLayerPreviewIcon(QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
Draws a symbol layer preview to an icon.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
void setPath(const QString &path)
Set the marker SVG path.
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for lengths used in the custom dash pattern.
bool referencePoint1IsCentroid() const
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features...
QgsSymbol::SymbolType symbolType() const
Access the symbol type.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern's offset.
QChar character() const
Returns the character used when rendering points.
void setCoordinateMode(FillCoordinateMode mode)
Set the coordinate mode for fill.
virtual void setColor(const QColor &color)
The fill color.
void setOffset(QPointF offset)
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
bool referencePoint2IsCentroid() const
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
A dialog to create a new auxiliary layer.
void setField(const QString &field)
Sets the field name the property references.
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image's width.
A class for filling symbols with a repeated raster image.
void setPlacement(Placement p)
The placement of the markers.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
A dialog to enter a custom dash space pattern for lines.
void setStrokeColor(const QColor &color) override
Set stroke color.
bool pointOnSurface() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
const QgsMapUnitScale & offsetMapUnitScale() const
void setColor(const QColor &color) override
The fill color.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
double strokeWidth() const
Returns the marker's stroke width.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for markers.
void setReferencePoint1(QPointF referencePoint)
Starting point of gradient fill, in the range [0,0] - [1,1].
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's stroke.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
Gradient coordinate mode.
const QgsMapUnitScale & customDashPatternMapUnitScale() const
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
Render the interior rings only.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for markers...
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides...
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
const QgsMapUnitScale & distanceXMapUnitScale() const
points (e.g., for font sizes)
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient. Controls how the gradient stops are positioned.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
QVector< qreal > customDashVector() const
QString imageFilePath() const
The path to the raster image used for the fill.
void setStrokeStyle(Qt::PenStyle strokeStyle)
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
QColor fillColor() const override
Gets fill color.
Filename, eg for svg files.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
void setSymbolType(QgsSymbol::SymbolType symbolType)
Set the type of symbol which should be created.
void setStrokeWidth(double w)
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
bool useCustomDashPattern() const
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
Shapeburst fill from edge distance.
void setCharacter(QChar ch)
Sets the character used when rendering points.
Character, eg for font marker symbol layers.
void setPenJoinStyle(Qt::PenJoinStyle style)
Single scope for storing variables and functions for use within a QgsExpressionContext.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
A store for object properties.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for markers...
Tiling is based on feature bounding box.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
void setOffset(QPointF offset)
Sets the offset for the fill.
QgsUnitTypes::RenderUnit offsetUnit() const
double strokeWidth() const
Returns the width of the marker's stroke.
void setPenStyle(Qt::PenStyle style)
const QgsMapUnitScale & displacementYMapUnitScale() const
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition for a property.
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the stroke width.
Gradient reference point 1 y.
void setStrokeColor(const QColor &strokeColor) override
Set stroke color.
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for markers.
void setOffset(QPointF offset)
Offset for gradient fill.
GradientSpread gradientSpread() const
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops...
Qt::PenJoinStyle penJoinStyle() const
VerticalAnchorPoint
Symbol vertical anchor points.
void expressionChanged(const QString &expression)
Emitted when the expression is changed.
void setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal distance between points in the pattern.
void setPenCapStyle(Qt::PenCapStyle style)
void setDisplacementY(double d)
void sourceChanged(const QString &source)
Emitted whenever the SVG source is changed in the widget.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
QString path() const
Returns the marker SVG path.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
A model for displaying SVG search paths.
virtual double width() const
Returns the estimated width for the line symbol layer.
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam, double &defaultStrokeWidth) const
Tests if an svg file contains parameters for fill, stroke color, stroke width.
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
A class for filling symbols with a repeated SVG file.
void setMapUnitScale(const QgsMapUnitScale &scale) override
Stroke style (eg solid, dashed)
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QgsSimpleLineSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
bool exists(const QgsPropertyDefinition &definition) const
Returns true if the property is stored in the layer already, false otherwise.
void setShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Sets the rendered marker shape.
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setGradientColorType(GradientColorType gradientColorType)
QPointF offset() const
Returns the offset for the fill.
void setWidthUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the image's width.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
QgsSvgMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
QgsSimpleMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
Shape
Marker symbol shapes.
const QgsMapUnitScale & distanceYMapUnitScale() const
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
void setSvgFilePath(const QString &svgPath)
Sets the path to the SVG file to render in the fill.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill's stroke.
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between markers.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's offset.
virtual void setSize(double size)
Sets the symbol size.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
QColor fillColor() const override
Gets fill color.
QgsPropertyDefinition propertyDefinition() const
Returns the underlying property definition.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
void setDisplacementXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDistanceY(double d)
Secondary color (eg for gradient fills)
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between markers.
void setCustomDashVector(const QVector< qreal > &vector)
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
QPointF referencePoint1() const
static const QString EXPR_CLUSTER_SIZE
Inbuilt variable name for cluster size variable.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setColor2(const QColor &color2)
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point...
void setAngle(double angle)
Sets the rotation angle for the marker.
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer...
void setDistanceX(double d)
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double distance() const
Returns the distance between lines in the fill pattern.
Render the exterior ring only.
void setBrushStyle(Qt::BrushStyle style)
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setFillColor(const QColor &color) override
Set fill color.
static bool shapeIsFilled(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Returns true if a symbol shape has a fill.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
QColor strokeColor() const override
Gets stroke color.
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the marker placement.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
Qt::PenCapStyle penCapStyle() const
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
double width() const
Returns the width used for scaling the image used in the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
QgsSimpleMarkerSymbolLayerBase::Shape shape() const
Returns the shape for the rendered marker symbol.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Units for gradient fill offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
void setColorType(ShapeburstColorType colorType)
Sets the color mode to use for the shapeburst fill.
Fill style (eg solid, dots)
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
Represents a vector layer which manages a vector based data sets.
GradientType gradientType() const
Type of gradient, e.g., linear or radial.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical distance between points in the pattern.
virtual QColor color() const
The fill color.
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
void setDisplacementX(double d)
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
QgsFilledMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Gradient reference point 2 is centroid.
void setGradientSpread(GradientSpread gradientSpread)
double displacementY() const
void setCoordinateMode(GradientCoordinateMode coordinateMode)
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
Gradient reference point 2 x.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
Property
Data definable properties.
QPointF offset() const
Returns the offset for the shapeburst fill.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
const QgsMapUnitScale & offsetMapUnitScale() const
void setPenJoinStyle(Qt::PenJoinStyle style)
A dialog to create a new auxiliary field.
void setPointOnSurface(bool pointOnSurface)
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
QPointF referencePoint2() const
void setOffset(double offset)
Horizontal distance between points.
virtual QString layerType() const =0
Returns a string that represents this layer type.
double offsetAlongLine() const
Returns the offset along the line for the marker placement.
Vertical distance between points.