47 #include <QAbstractButton> 48 #include <QButtonGroup> 49 #include <QColorDialog> 52 #include <QFileDialog> 54 #include <QStandardItemModel> 55 #include <QSvgRenderer> 56 #include <QMessageBox> 59 #include <QInputDialog> 75 expContext << symbolScope;
89 expContext.setOriginalValueVariable( QVariant() );
102 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
123 void QgsSymbolLayerWidget::createAuxiliaryField()
144 if ( dlg.exec() == QDialog::Accepted )
155 property.setActive(
true );
177 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
178 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
182 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
190 btnChangeColor->setAllowOpacity(
true );
191 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
192 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
194 mColorDDBtn->registerLinkedWidget( btnChangeColor );
199 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
203 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
208 spinOffset->setClearValue( 0.0 );
213 mDrawInsideCheckBox->hide();
214 mRingFilterComboBox->hide();
222 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
224 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
226 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
227 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
228 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
229 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
236 void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
238 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
240 mAssistantPreviewSymbol->deleteSymbolLayer( i );
242 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
245 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
251 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
258 mPenWidthUnitWidget->blockSignals(
true );
261 mPenWidthUnitWidget->blockSignals(
false );
262 mOffsetUnitWidget->blockSignals(
true );
265 mOffsetUnitWidget->blockSignals(
false );
266 mDashPatternUnitWidget->blockSignals(
true );
270 mDashPatternUnitWidget->blockSignals(
false );
273 spinWidth->blockSignals(
true );
275 spinWidth->blockSignals(
false );
276 btnChangeColor->blockSignals(
true );
278 btnChangeColor->blockSignals(
false );
279 spinOffset->blockSignals(
true );
281 spinOffset->blockSignals(
false );
282 cboPenStyle->blockSignals(
true );
283 cboJoinStyle->blockSignals(
true );
284 cboCapStyle->blockSignals(
true );
288 cboPenStyle->blockSignals(
false );
289 cboJoinStyle->blockSignals(
false );
290 cboCapStyle->blockSignals(
false );
294 mChangePatternButton->setEnabled( useCustomDashPattern );
295 label_3->setEnabled( !useCustomDashPattern );
296 cboPenStyle->setEnabled( !useCustomDashPattern );
297 mCustomCheckBox->blockSignals(
true );
298 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
299 mCustomCheckBox->blockSignals(
false );
302 QSize size = mChangePatternButton->minimumSizeHint();
304 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
308 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
322 updateAssistantSymbol();
330 void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
337 void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
343 void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
352 void QgsSimpleLineSymbolLayerWidget::offsetChanged()
359 void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
361 bool checked = ( state == Qt::Checked );
362 mChangePatternButton->setEnabled( checked );
363 label_3->setEnabled( !checked );
364 cboPenStyle->setEnabled( !checked );
370 void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
377 widget->
setUnit( mDashPatternUnitWidget->unit() );
389 d.
setUnit( mDashPatternUnitWidget->unit() );
390 if ( d.exec() == QDialog::Accepted )
398 void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
409 void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
419 void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
430 void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
432 bool checked = ( state == Qt::Checked );
444 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
449 QColor color = qApp->palette().color( QPalette::WindowText );
450 layerCopy->setColor( color );
452 layerCopy->setOffset( 0 );
453 layerCopy->setUseCustomDashPattern(
true );
455 QSize currentIconSize;
458 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
460 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
463 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
469 std::unique_ptr< QgsLineSymbol > previewSymbol = qgis::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
471 mChangePatternButton->setIconSize( currentIconSize );
472 mChangePatternButton->setIcon( icon );
477 int height =
static_cast< int >( width / 1.61803398875 );
481 QBuffer buffer( &data );
482 pm.save( &buffer,
"PNG", 100 );
483 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
488 QgsSymbolLayerWidget::resizeEvent( event );
506 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
507 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
508 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
509 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
517 btnChangeColorFill->setAllowOpacity(
true );
518 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
519 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
520 btnChangeColorFill->setShowNoColor(
true );
521 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
522 btnChangeColorStroke->setAllowOpacity(
true );
523 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
524 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
525 btnChangeColorStroke->setShowNoColor(
true );
526 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
528 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
529 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
531 spinOffsetX->setClearValue( 0.0 );
532 spinOffsetY->setClearValue( 0.0 );
533 spinAngle->setClearValue( 0.0 );
539 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
541 int size = lstNames->iconSize().width();
542 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXX" ) ) ) ) );
543 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
544 lstNames->setIconSize( QSize( size, size ) );
546 double markerSize = size * 0.8;
552 lyr->
setColor( QColor( 200, 200, 200 ) );
555 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
556 item->setData( Qt::UserRole, static_cast< int >( shape ) );
561 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
563 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
566 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
567 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
568 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
569 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
570 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
576 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
584 for (
int i = 0; i < lstNames->count(); ++i )
586 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
588 lstNames->setCurrentRow( i );
592 btnChangeColorStroke->blockSignals(
true );
594 btnChangeColorStroke->blockSignals(
false );
595 btnChangeColorFill->blockSignals(
true );
598 btnChangeColorFill->blockSignals(
false );
599 spinSize->blockSignals(
true );
601 spinSize->blockSignals(
false );
602 spinAngle->blockSignals(
true );
604 spinAngle->blockSignals(
false );
605 mStrokeStyleComboBox->blockSignals(
true );
607 mStrokeStyleComboBox->blockSignals(
false );
608 mStrokeWidthSpinBox->blockSignals(
true );
610 mStrokeWidthSpinBox->blockSignals(
false );
611 cboJoinStyle->blockSignals(
true );
613 cboJoinStyle->blockSignals(
false );
616 spinOffsetX->blockSignals(
true );
618 spinOffsetX->blockSignals(
false );
619 spinOffsetY->blockSignals(
true );
621 spinOffsetY->blockSignals(
false );
623 mSizeUnitWidget->blockSignals(
true );
626 mSizeUnitWidget->blockSignals(
false );
627 mOffsetUnitWidget->blockSignals(
true );
630 mOffsetUnitWidget->blockSignals(
false );
631 mStrokeWidthUnitWidget->blockSignals(
true );
634 mStrokeWidthUnitWidget->blockSignals(
false );
637 mHorizontalAnchorComboBox->blockSignals(
true );
638 mVerticalAnchorComboBox->blockSignals(
true );
641 mHorizontalAnchorComboBox->blockSignals(
false );
642 mVerticalAnchorComboBox->blockSignals(
false );
656 updateAssistantSymbol();
664 void QgsSimpleMarkerSymbolLayerWidget::setShape()
666 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
683 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
689 void QgsSimpleMarkerSymbolLayerWidget::setSize()
695 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
701 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
703 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
707 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
718 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
727 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
737 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
747 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
757 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
766 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
775 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
777 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
779 mAssistantPreviewSymbol->deleteSymbolLayer( i );
781 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
784 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
803 btnChangeColor->setAllowOpacity(
true );
804 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
805 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
806 btnChangeColor->setShowNoColor(
true );
807 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
808 btnChangeStrokeColor->setAllowOpacity(
true );
809 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
810 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
811 btnChangeStrokeColor->setShowNoColor(
true );
812 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
814 spinOffsetX->setClearValue( 0.0 );
815 spinOffsetY->setClearValue( 0.0 );
818 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
820 connect( spinStrokeWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
821 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
822 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
823 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
824 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
826 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
827 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
832 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
839 btnChangeColor->blockSignals(
true );
841 btnChangeColor->blockSignals(
false );
842 cboFillStyle->blockSignals(
true );
844 cboFillStyle->blockSignals(
false );
845 btnChangeStrokeColor->blockSignals(
true );
847 btnChangeStrokeColor->blockSignals(
false );
848 cboStrokeStyle->blockSignals(
true );
850 cboStrokeStyle->blockSignals(
false );
851 spinStrokeWidth->blockSignals(
true );
853 spinStrokeWidth->blockSignals(
false );
854 cboJoinStyle->blockSignals(
true );
856 cboJoinStyle->blockSignals(
false );
857 spinOffsetX->blockSignals(
true );
859 spinOffsetX->blockSignals(
false );
860 spinOffsetY->blockSignals(
true );
862 spinOffsetY->blockSignals(
false );
864 mStrokeWidthUnitWidget->blockSignals(
true );
867 mStrokeWidthUnitWidget->blockSignals(
false );
868 mOffsetUnitWidget->blockSignals(
true );
871 mOffsetUnitWidget->blockSignals(
false );
899 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
905 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
911 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
918 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
920 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
924 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
934 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
954 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
955 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
961 spinOffsetX->setClearValue( 0.0 );
962 spinOffsetY->setClearValue( 0.0 );
963 spinAngle->setClearValue( 0.0 );
969 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
971 int size = lstNames->iconSize().width();
972 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXX" ) ) ) ) );
973 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
974 lstNames->setIconSize( QSize( size, size ) );
976 double markerSize = size * 0.8;
982 lyr->
setColor( QColor( 200, 200, 200 ) );
985 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
986 item->setData( Qt::UserRole, static_cast< int >( shape ) );
991 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
993 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
994 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
995 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
996 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
997 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1003 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1011 for (
int i = 0; i < lstNames->count(); ++i )
1013 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1015 lstNames->setCurrentRow( i );
1024 mSizeUnitWidget->blockSignals(
true );
1027 mSizeUnitWidget->blockSignals(
false );
1028 mOffsetUnitWidget->blockSignals(
true );
1031 mOffsetUnitWidget->blockSignals(
false );
1044 updateAssistantSymbol();
1052 void QgsFilledMarkerSymbolLayerWidget::setShape()
1054 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
1058 void QgsFilledMarkerSymbolLayerWidget::setSize()
1064 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1070 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1072 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1076 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1086 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1096 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1105 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1114 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1116 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1118 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1120 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1123 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1136 connect( mSpinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1140 btnColorRamp->setShowGradientOnly(
true );
1142 btnChangeColor->setAllowOpacity(
true );
1143 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1144 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1145 btnChangeColor->setShowNoColor(
true );
1146 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1147 btnChangeColor2->setAllowOpacity(
true );
1148 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1149 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1150 btnChangeColor2->setShowNoColor(
true );
1151 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1153 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1154 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1156 spinOffsetX->setClearValue( 0.0 );
1157 spinOffsetY->setClearValue( 0.0 );
1158 mSpinAngle->setClearValue( 0.0 );
1166 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1167 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1168 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1169 connect( spinRefPoint1X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1170 connect( spinRefPoint1Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1171 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1172 connect( spinRefPoint2X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1173 connect( spinRefPoint2Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1174 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1179 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1186 btnChangeColor->blockSignals(
true );
1188 btnChangeColor->blockSignals(
false );
1189 btnChangeColor2->blockSignals(
true );
1191 btnChangeColor2->blockSignals(
false );
1195 radioTwoColor->setChecked(
true );
1196 btnColorRamp->setEnabled(
false );
1200 radioColorRamp->setChecked(
true );
1201 btnChangeColor->setEnabled(
false );
1202 btnChangeColor2->setEnabled(
false );
1208 btnColorRamp->blockSignals(
true );
1210 btnColorRamp->blockSignals(
false );
1213 cboGradientType->blockSignals(
true );
1217 cboGradientType->setCurrentIndex( 0 );
1220 cboGradientType->setCurrentIndex( 1 );
1223 cboGradientType->setCurrentIndex( 2 );
1226 cboGradientType->blockSignals(
false );
1228 cboCoordinateMode->blockSignals(
true );
1232 cboCoordinateMode->setCurrentIndex( 1 );
1233 checkRefPoint1Centroid->setEnabled(
false );
1234 checkRefPoint2Centroid->setEnabled(
false );
1238 cboCoordinateMode->setCurrentIndex( 0 );
1241 cboCoordinateMode->blockSignals(
false );
1243 cboGradientSpread->blockSignals(
true );
1247 cboGradientSpread->setCurrentIndex( 0 );
1250 cboGradientSpread->setCurrentIndex( 1 );
1253 cboGradientSpread->setCurrentIndex( 2 );
1256 cboGradientSpread->blockSignals(
false );
1258 spinRefPoint1X->blockSignals(
true );
1260 spinRefPoint1X->blockSignals(
false );
1261 spinRefPoint1Y->blockSignals(
true );
1263 spinRefPoint1Y->blockSignals(
false );
1264 checkRefPoint1Centroid->blockSignals(
true );
1268 spinRefPoint1X->setEnabled(
false );
1269 spinRefPoint1Y->setEnabled(
false );
1271 checkRefPoint1Centroid->blockSignals(
false );
1272 spinRefPoint2X->blockSignals(
true );
1274 spinRefPoint2X->blockSignals(
false );
1275 spinRefPoint2Y->blockSignals(
true );
1277 spinRefPoint2Y->blockSignals(
false );
1278 checkRefPoint2Centroid->blockSignals(
true );
1282 spinRefPoint2X->setEnabled(
false );
1283 spinRefPoint2Y->setEnabled(
false );
1285 checkRefPoint2Centroid->blockSignals(
false );
1287 spinOffsetX->blockSignals(
true );
1289 spinOffsetX->blockSignals(
false );
1290 spinOffsetY->blockSignals(
true );
1292 spinOffsetY->blockSignals(
false );
1293 mSpinAngle->blockSignals(
true );
1295 mSpinAngle->blockSignals(
false );
1297 mOffsetUnitWidget->blockSignals(
true );
1300 mOffsetUnitWidget->blockSignals(
false );
1333 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1335 if ( radioTwoColor->isChecked() )
1348 if ( btnColorRamp->isNull() )
1362 spinRefPoint1X->setValue( 0.5 );
1363 spinRefPoint1Y->setValue( 0 );
1364 spinRefPoint2X->setValue( 0.5 );
1365 spinRefPoint2Y->setValue( 1 );
1370 spinRefPoint1X->setValue( 0 );
1371 spinRefPoint1Y->setValue( 0 );
1372 spinRefPoint2X->setValue( 1 );
1373 spinRefPoint2Y->setValue( 1 );
1377 spinRefPoint1X->setValue( 0.5 );
1378 spinRefPoint1Y->setValue( 0.5 );
1379 spinRefPoint2X->setValue( 1 );
1380 spinRefPoint2Y->setValue( 1 );
1395 checkRefPoint1Centroid->setEnabled(
true );
1396 checkRefPoint2Centroid->setEnabled(
true );
1402 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1403 checkRefPoint1Centroid->setEnabled(
false );
1404 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1405 checkRefPoint2Centroid->setEnabled(
false );
1430 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1432 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1436 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1445 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1451 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1469 connect( mSpinBlurRadius, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1470 connect( mSpinMaxDistance, qgis::overload< double >::of( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1472 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1474 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1480 QButtonGroup *group1 =
new QButtonGroup(
this );
1481 group1->addButton( radioColorRamp );
1482 group1->addButton( radioTwoColor );
1483 QButtonGroup *group2 =
new QButtonGroup(
this );
1484 group2->addButton( mRadioUseMaxDistance );
1485 group2->addButton( mRadioUseWholeShape );
1486 btnChangeColor->setAllowOpacity(
true );
1487 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1488 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1489 btnChangeColor->setShowNoColor(
true );
1490 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1491 btnChangeColor2->setAllowOpacity(
true );
1492 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1493 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1494 btnChangeColor2->setShowNoColor(
true );
1495 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1497 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1498 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1500 spinOffsetX->setClearValue( 0.0 );
1501 spinOffsetY->setClearValue( 0.0 );
1503 btnColorRamp->setShowGradientOnly(
true );
1509 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1510 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1511 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1513 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1514 connect( mSpinBlurRadius, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1519 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1526 btnChangeColor->blockSignals(
true );
1528 btnChangeColor->blockSignals(
false );
1529 btnChangeColor2->blockSignals(
true );
1531 btnChangeColor2->blockSignals(
false );
1535 radioTwoColor->setChecked(
true );
1536 btnColorRamp->setEnabled(
false );
1540 radioColorRamp->setChecked(
true );
1541 btnChangeColor->setEnabled(
false );
1542 btnChangeColor2->setEnabled(
false );
1545 mSpinBlurRadius->blockSignals(
true );
1546 mBlurSlider->blockSignals(
true );
1549 mSpinBlurRadius->blockSignals(
false );
1550 mBlurSlider->blockSignals(
false );
1552 mSpinMaxDistance->blockSignals(
true );
1554 mSpinMaxDistance->blockSignals(
false );
1556 mRadioUseWholeShape->blockSignals(
true );
1557 mRadioUseMaxDistance->blockSignals(
true );
1560 mRadioUseWholeShape->setChecked(
true );
1561 mSpinMaxDistance->setEnabled(
false );
1562 mDistanceUnitWidget->setEnabled(
false );
1566 mRadioUseMaxDistance->setChecked(
true );
1567 mSpinMaxDistance->setEnabled(
true );
1568 mDistanceUnitWidget->setEnabled(
true );
1570 mRadioUseWholeShape->blockSignals(
false );
1571 mRadioUseMaxDistance->blockSignals(
false );
1573 mDistanceUnitWidget->blockSignals(
true );
1576 mDistanceUnitWidget->blockSignals(
false );
1578 mIgnoreRingsCheckBox->blockSignals(
true );
1579 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1580 mIgnoreRingsCheckBox->blockSignals(
false );
1585 btnColorRamp->blockSignals(
true );
1587 btnColorRamp->blockSignals(
false );
1590 spinOffsetX->blockSignals(
true );
1592 spinOffsetX->blockSignals(
false );
1593 spinOffsetY->blockSignals(
true );
1595 spinOffsetY->blockSignals(
false );
1596 mOffsetUnitWidget->blockSignals(
true );
1599 mOffsetUnitWidget->blockSignals(
false );
1632 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1639 if ( radioTwoColor->isChecked() )
1650 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1659 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1668 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1678 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1683 mDistanceUnitWidget->setEnabled( !value );
1688 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1698 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1702 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1707 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1718 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1720 bool checked = ( state == Qt::Checked );
1749 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1753 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
1758 spinOffset->setClearValue( 0.0 );
1763 mRingFilterComboBox->hide();
1764 mRingsLabel->hide();
1767 mSpinAverageAngleLength->setClearValue( 4.0 );
1771 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1772 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1773 connect( mSpinAverageAngleLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1774 connect( radInterval, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1775 connect( radVertex, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1776 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1777 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1778 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1779 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1784 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1791 spinInterval->blockSignals(
true );
1793 spinInterval->blockSignals(
false );
1794 mSpinOffsetAlongLine->blockSignals(
true );
1796 mSpinOffsetAlongLine->blockSignals(
false );
1797 chkRotateMarker->blockSignals(
true );
1799 chkRotateMarker->blockSignals(
false );
1800 spinOffset->blockSignals(
true );
1802 spinOffset->blockSignals(
false );
1804 radInterval->setChecked(
true );
1806 radVertex->setChecked(
true );
1808 radVertexLast->setChecked(
true );
1810 radCentralPoint->setChecked(
true );
1812 radCurvePoint->setChecked(
true );
1814 radVertexFirst->setChecked(
true );
1817 mIntervalUnitWidget->blockSignals(
true );
1820 mIntervalUnitWidget->blockSignals(
false );
1821 mOffsetUnitWidget->blockSignals(
true );
1824 mOffsetUnitWidget->blockSignals(
false );
1825 mOffsetAlongLineUnitWidget->blockSignals(
true );
1828 mOffsetAlongLineUnitWidget->blockSignals(
false );
1862 void QgsMarkerLineSymbolLayerWidget::setRotate()
1864 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1865 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1871 void QgsMarkerLineSymbolLayerWidget::setOffset()
1877 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1879 bool interval = radInterval->isChecked();
1880 spinInterval->setEnabled( interval );
1881 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1882 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
1883 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1884 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1886 if ( radInterval->isChecked() )
1888 else if ( radVertex->isChecked() )
1890 else if ( radVertexLast->isChecked() )
1892 else if ( radVertexFirst->isChecked() )
1894 else if ( radCurvePoint->isChecked() )
1902 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
1912 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
1922 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
1932 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
1942 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
1979 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1983 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
1988 spinOffset->setClearValue( 0.0 );
1993 mRingFilterComboBox->hide();
1994 mRingsLabel->hide();
1997 mHashRotationSpinBox->setClearValue( 0 );
1998 mSpinAverageAngleLength->setClearValue( 4.0 );
2000 connect( spinInterval, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2001 connect( mSpinOffsetAlongLine, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2002 connect( mSpinHashLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2003 connect( mHashRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2004 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2005 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2006 connect( mSpinAverageAngleLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2007 connect( radInterval, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2008 connect( radVertex, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2009 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2010 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2011 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2012 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2017 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2024 spinInterval->blockSignals(
true );
2025 spinInterval->setValue( mLayer->
interval() );
2026 spinInterval->blockSignals(
false );
2027 mSpinOffsetAlongLine->blockSignals(
true );
2029 mSpinOffsetAlongLine->blockSignals(
false );
2032 chkRotateMarker->blockSignals(
true );
2034 chkRotateMarker->blockSignals(
false );
2035 spinOffset->blockSignals(
true );
2036 spinOffset->setValue( mLayer->
offset() );
2037 spinOffset->blockSignals(
false );
2039 radInterval->setChecked(
true );
2041 radVertex->setChecked(
true );
2043 radVertexLast->setChecked(
true );
2045 radCentralPoint->setChecked(
true );
2047 radCurvePoint->setChecked(
true );
2049 radVertexFirst->setChecked(
true );
2052 mIntervalUnitWidget->blockSignals(
true );
2053 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2055 mIntervalUnitWidget->blockSignals(
false );
2056 mOffsetUnitWidget->blockSignals(
true );
2057 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2059 mOffsetUnitWidget->blockSignals(
false );
2060 mOffsetAlongLineUnitWidget->blockSignals(
true );
2063 mOffsetAlongLineUnitWidget->blockSignals(
false );
2070 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2088 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2094 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2100 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2106 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2112 void QgsHashedLineSymbolLayerWidget::setRotate()
2114 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2115 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2121 void QgsHashedLineSymbolLayerWidget::setOffset()
2123 mLayer->
setOffset( spinOffset->value() );
2127 void QgsHashedLineSymbolLayerWidget::setPlacement()
2129 bool interval = radInterval->isChecked();
2130 spinInterval->setEnabled( interval );
2131 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
2132 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2133 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2134 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2136 if ( radInterval->isChecked() )
2138 else if ( radVertex->isChecked() )
2140 else if ( radVertexLast->isChecked() )
2142 else if ( radVertexFirst->isChecked() )
2144 else if ( radCurvePoint->isChecked() )
2152 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2162 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2172 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2182 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2192 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2202 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2221 mSvgSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2225 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2226 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2230 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2231 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2238 viewGroups->setHeaderHidden(
true );
2239 mChangeColorButton->setAllowOpacity(
true );
2240 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2241 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2242 mChangeStrokeColorButton->setAllowOpacity(
true );
2243 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2244 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2246 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2247 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2249 spinOffsetX->setClearValue( 0.0 );
2250 spinOffsetY->setClearValue( 0.0 );
2251 spinAngle->setClearValue( 0.0 );
2253 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXXX" ) ) ) ) );
2254 viewImages->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2258 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2259 connect( viewGroups->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::populateIcons );
2260 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2261 connect( spinHeight, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2263 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2264 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2265 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2274 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2275 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2280 #include <QAbstractListModel> 2281 #include <QPixmapCache> 2287 QAbstractItemModel *oldModel = viewGroups->model();
2289 viewGroups->setModel( g );
2293 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2294 for (
int i = 0; i < rows; i++ )
2296 viewGroups->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2300 oldModel = viewImages->model();
2302 viewImages->setModel( m );
2306 void QgsSvgMarkerSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2308 QString path = idx.data( Qt::UserRole + 1 ).toString();
2310 QAbstractItemModel *oldModel = viewImages->model();
2312 viewImages->setModel( m );
2315 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2326 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2327 QColor defaultFill, defaultStroke;
2328 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2329 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2331 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2332 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2333 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2334 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2335 mChangeColorButton->setEnabled( hasFillParam );
2336 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2337 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2338 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2339 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2344 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2345 if ( hasDefaultFillColor )
2349 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2350 mChangeColorButton->setColor( fill );
2352 if ( hasStrokeParam )
2355 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2356 if ( hasDefaultStrokeColor )
2358 stroke = defaultStroke;
2360 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2361 mChangeStrokeColorButton->setColor( stroke );
2366 mStrokeWidthSpinBox->blockSignals(
true );
2367 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2368 mStrokeWidthSpinBox->blockSignals(
false );
2371 spinHeight->blockSignals(
true );
2372 if ( preservedAspectRatio )
2374 spinHeight->setValue( layer->
size() );
2381 spinHeight->blockSignals(
false );
2382 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2385 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2387 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2389 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2391 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2394 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2405 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2413 QAbstractItemModel *m = viewImages->model();
2414 QItemSelectionModel *selModel = viewImages->selectionModel();
2415 for (
int i = 0; i < m->rowCount(); i++ )
2417 QModelIndex idx( m->index( i, 0 ) );
2418 if ( m->data( idx ).toString() ==
mLayer->
path() )
2420 selModel->select( idx, QItemSelectionModel::SelectCurrent );
2421 selModel->setCurrentIndex( idx, QItemSelectionModel::SelectCurrent );
2427 spinWidth->blockSignals(
true );
2429 spinWidth->blockSignals(
false );
2430 spinAngle->blockSignals(
true );
2432 spinAngle->blockSignals(
false );
2435 spinOffsetX->blockSignals(
true );
2437 spinOffsetX->blockSignals(
false );
2438 spinOffsetY->blockSignals(
true );
2440 spinOffsetY->blockSignals(
false );
2442 mSizeUnitWidget->blockSignals(
true );
2445 mSizeUnitWidget->blockSignals(
false );
2446 mStrokeWidthUnitWidget->blockSignals(
true );
2449 mStrokeWidthUnitWidget->blockSignals(
false );
2450 mOffsetUnitWidget->blockSignals(
true );
2453 mOffsetUnitWidget->blockSignals(
false );
2456 mHorizontalAnchorComboBox->blockSignals(
true );
2457 mVerticalAnchorComboBox->blockSignals(
true );
2460 mHorizontalAnchorComboBox->blockSignals(
false );
2461 mVerticalAnchorComboBox->blockSignals(
false );
2476 updateAssistantSymbol();
2487 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2490 void QgsSvgMarkerSymbolLayerWidget::setName(
const QModelIndex &idx )
2492 QString name = idx.data( Qt::UserRole ).toString();
2500 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2503 double fixedAspectRatio = 0.0;
2504 spinHeight->blockSignals(
true );
2505 if ( defaultAspectRatio <= 0.0 )
2507 spinHeight->setValue( spinWidth->value() );
2509 else if ( mLockAspectRatio->locked() )
2511 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2515 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2517 spinHeight->blockSignals(
false );
2523 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2526 double fixedAspectRatio = 0.0;
2527 spinWidth->blockSignals(
true );
2528 if ( defaultAspectRatio <= 0.0 )
2530 spinWidth->setValue( spinHeight->value() );
2532 else if ( mLockAspectRatio->locked() )
2534 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2538 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2540 spinWidth->blockSignals(
false );
2546 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2550 if ( defaultAspectRatio <= 0.0 )
2566 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2572 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2574 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2578 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2585 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2596 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2607 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2616 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2626 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2636 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2646 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2655 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2670 connect( mTextureWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2672 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2674 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2675 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2682 mSvgTreeView->setHeaderHidden(
true );
2685 mRotationSpinBox->setClearValue( 0.0 );
2687 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2688 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2689 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2690 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2692 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2693 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2695 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2696 connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::populateIcons );
2706 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2715 mTextureWidthSpinBox->blockSignals(
true );
2716 mTextureWidthSpinBox->setValue( width );
2717 mTextureWidthSpinBox->blockSignals(
false );
2719 mRotationSpinBox->blockSignals(
true );
2721 mRotationSpinBox->blockSignals(
false );
2722 mTextureWidthUnitWidget->blockSignals(
true );
2725 mTextureWidthUnitWidget->blockSignals(
false );
2726 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2729 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2730 mChangeColorButton->blockSignals(
true );
2732 mChangeColorButton->blockSignals(
false );
2733 mChangeStrokeColorButton->blockSignals(
true );
2735 mChangeStrokeColorButton->blockSignals(
false );
2736 mStrokeWidthSpinBox->blockSignals(
true );
2738 mStrokeWidthSpinBox->blockSignals(
false );
2758 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2761 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2770 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2782 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex &item )
2784 QString file = item.data( Qt::UserRole ).toString();
2794 QAbstractItemModel *oldModel = mSvgTreeView->model();
2796 mSvgTreeView->setModel( g );
2800 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2801 for (
int i = 0; i < rows; i++ )
2803 mSvgTreeView->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2806 oldModel = mSvgListView->model();
2808 mSvgListView->setModel( m );
2812 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2814 QString path = idx.data( Qt::UserRole + 1 ).toString();
2816 QAbstractItemModel *oldModel = mSvgListView->model();
2818 mSvgListView->setModel( m );
2821 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2825 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2837 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2838 QColor defaultFill, defaultStroke;
2839 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2840 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2842 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2843 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2844 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2845 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2848 QColor fill = mChangeColorButton->color();
2849 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2850 if ( hasDefaultFillColor )
2854 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2855 mChangeColorButton->setColor( fill );
2857 mChangeColorButton->setEnabled( hasFillParam );
2858 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2861 QColor stroke = mChangeStrokeColorButton->color();
2862 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2863 if ( hasDefaultStrokeColor )
2865 stroke = defaultStroke;
2867 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2868 mChangeStrokeColorButton->setColor( stroke );
2870 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2871 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2872 if ( hasDefaultStrokeWidth && resetValues )
2874 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2876 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2879 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2890 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2901 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2910 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2920 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
2936 connect( mAngleSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
2937 connect( mDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
2938 connect( mOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
2945 mOffsetSpinBox->setClearValue( 0 );
2946 mAngleSpinBox->setClearValue( 0 );
2951 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
2960 mAngleSpinBox->blockSignals(
true );
2962 mAngleSpinBox->blockSignals(
false );
2963 mDistanceSpinBox->blockSignals(
true );
2965 mDistanceSpinBox->blockSignals(
false );
2966 mOffsetSpinBox->blockSignals(
true );
2968 mOffsetSpinBox->blockSignals(
false );
2971 mDistanceUnitWidget->blockSignals(
true );
2974 mDistanceUnitWidget->blockSignals(
false );
2975 mOffsetUnitWidget->blockSignals(
true );
2978 mOffsetUnitWidget->blockSignals(
false );
2990 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
2999 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3008 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3017 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3027 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3043 connect( mHorizontalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3044 connect( mVerticalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3045 connect( mHorizontalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3046 connect( mVerticalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3047 connect( mHorizontalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3048 connect( mVerticalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3049 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3050 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3051 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3052 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3053 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3054 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3072 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3085 mHorizontalDistanceUnitWidget->blockSignals(
true );
3088 mHorizontalDistanceUnitWidget->blockSignals(
false );
3089 mVerticalDistanceUnitWidget->blockSignals(
true );
3092 mVerticalDistanceUnitWidget->blockSignals(
false );
3093 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3096 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3097 mVerticalDisplacementUnitWidget->blockSignals(
true );
3100 mVerticalDisplacementUnitWidget->blockSignals(
false );
3101 mHorizontalOffsetUnitWidget->blockSignals(
true );
3104 mHorizontalOffsetUnitWidget->blockSignals(
false );
3105 mVerticalOffsetUnitWidget->blockSignals(
true );
3108 mVerticalOffsetUnitWidget->blockSignals(
false );
3123 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3132 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3141 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3150 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3159 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3168 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3177 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3187 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3197 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3207 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3217 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3227 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3248 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3249 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3250 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3260 scrollArea->setVerticalOnly(
true );
3262 btnColor->setAllowOpacity(
true );
3263 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3264 btnColor->setContext( QStringLiteral(
"symbology" ) );
3265 btnStrokeColor->setAllowOpacity(
true );
3266 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3267 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3269 mColorDDBtn->registerLinkedWidget( btnColor );
3270 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3272 spinOffsetX->setClearValue( 0.0 );
3273 spinOffsetY->setClearValue( 0.0 );
3274 spinAngle->setClearValue( 0.0 );
3280 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3284 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3287 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3289 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3290 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3299 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3327 mSizeUnitWidget->blockSignals(
true );
3330 mSizeUnitWidget->blockSignals(
false );
3332 mStrokeWidthUnitWidget->blockSignals(
true );
3335 mStrokeWidthUnitWidget->blockSignals(
false );
3337 mOffsetUnitWidget->blockSignals(
true );
3340 mOffsetUnitWidget->blockSignals(
false );
3359 updateAssistantSymbol();
3401 if ( text.isEmpty() )
3405 QString character = text;
3406 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3409 unsigned int value = text.toUInt( &ok, 0 );
3411 character = QChar( value );
3436 void QgsFontMarkerSymbolLayerWidget::setOffset()
3438 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3442 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3448 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3458 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3468 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3478 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3487 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3496 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3505 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3507 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3509 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3511 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3514 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3526 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3527 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3532 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3548 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3554 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3569 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3573 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3575 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3576 connect( mHeightSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3584 mSpinOffsetX->setClearValue( 0.0 );
3585 mSpinOffsetY->setClearValue( 0.0 );
3586 mRotationSpinBox->setClearValue( 0.0 );
3588 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3589 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3592 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3593 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3603 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3614 mHeightSpinBox->blockSignals(
true );
3615 if ( preservedAspectRatio )
3624 mHeightSpinBox->blockSignals(
false );
3625 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3633 mSizeUnitWidget->blockSignals(
true );
3636 mSizeUnitWidget->blockSignals(
false );
3637 mOffsetUnitWidget->blockSignals(
true );
3640 mOffsetUnitWidget->blockSignals(
false );
3655 updatePreviewImage();
3666 mImageSourceLineEdit->setMessageBar( context.
messageBar() );
3669 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3672 updatePreviewImage();
3676 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3678 bool fitsInCache =
false;
3680 if ( image.isNull() )
3682 mLabelImagePreview->setPixmap( QPixmap() );
3686 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3687 previewImage.fill( Qt::transparent );
3688 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3690 p.begin( &previewImage );
3692 uchar pixDataRGB[] = { 150, 150, 150, 150,
3697 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3698 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3699 QBrush checkerBrush;
3700 checkerBrush.setTexture( pix );
3701 p.fillRect( imageRect, checkerBrush );
3708 p.drawImage( imageRect.left(), imageRect.top(), image );
3710 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3713 void QgsRasterMarkerSymbolLayerWidget::setWidth()
3716 double fixedAspectRatio = 0.0;
3717 mHeightSpinBox->blockSignals(
true );
3718 if ( defaultAspectRatio <= 0.0 )
3720 mHeightSpinBox->setValue( mWidthSpinBox->value() );
3722 else if ( mLockAspectRatio->locked() )
3724 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
3728 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3730 mHeightSpinBox->blockSignals(
false );
3736 void QgsRasterMarkerSymbolLayerWidget::setHeight()
3739 double fixedAspectRatio = 0.0;
3740 mWidthSpinBox->blockSignals(
true );
3741 if ( defaultAspectRatio <= 0.0 )
3743 mWidthSpinBox->setValue( mHeightSpinBox->value() );
3745 else if ( mLockAspectRatio->locked() )
3747 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
3751 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3753 mWidthSpinBox->blockSignals(
false );
3759 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
3762 if ( defaultAspectRatio <= 0.0 )
3777 void QgsRasterMarkerSymbolLayerWidget::setAngle()
3783 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
3787 updatePreviewImage();
3790 void QgsRasterMarkerSymbolLayerWidget::setOffset()
3792 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3796 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3806 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3816 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3825 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3842 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3846 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
3848 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
3855 mSpinOffsetX->setClearValue( 0.0 );
3856 mSpinOffsetY->setClearValue( 0.0 );
3857 mRotationSpinBox->setClearValue( 0.0 );
3859 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
3860 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3861 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3873 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
3886 cboCoordinateMode->blockSignals(
true );
3890 cboCoordinateMode->setCurrentIndex( 1 );
3894 cboCoordinateMode->setCurrentIndex( 0 );
3897 cboCoordinateMode->blockSignals(
false );
3903 mOffsetUnitWidget->blockSignals(
true );
3906 mOffsetUnitWidget->blockSignals(
false );
3909 mWidthUnitWidget->blockSignals(
true );
3912 mWidthUnitWidget->blockSignals(
false );
3914 updatePreviewImage();
3927 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
3930 updatePreviewImage();
3934 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
3951 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
3960 updatePreviewImage();
3963 void QgsRasterFillSymbolLayerWidget::offsetChanged()
3965 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3969 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3980 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
3989 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4000 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4010 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4012 bool fitsInCache =
false;
4014 if ( image.isNull() )
4016 mLabelImagePreview->setPixmap( QPixmap() );
4020 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4021 previewImage.fill( Qt::transparent );
4022 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4024 p.begin( &previewImage );
4026 uchar pixDataRGB[] = { 150, 150, 150, 150,
4031 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4032 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4033 QBrush checkerBrush;
4034 checkerBrush.setTexture( pix );
4035 p.fillRect( imageRect, checkerBrush );
4042 p.drawImage( imageRect.left(), imageRect.top(), image );
4044 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4053 modificationExpressionSelector->setMultiLine(
true );
4054 modificationExpressionSelector->setLayer( const_cast<QgsVectorLayer *>( vl ) );
4055 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4060 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4067 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
4075 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4082 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4084 mLayer->
setSymbolType( static_cast<QgsSymbol::SymbolType>( cbxGeometryType->currentData().toInt() ) );
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
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.
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
double hashLength() const
Returns the length of hash symbols.
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...
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
static const QString EXPR_CLUSTER_COLOR
Inbuilt variable name for cluster color variable.
Place symbols on the first vertex in the line.
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.
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
Gradient reference point 1 is centroid.
const QgsMapUnitScale & displacementYMapUnitScale() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal offset for rows in the pattern.
static QIcon symbolLayerPreviewIcon(const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
Draws a symbol layer preview to an icon.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
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.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
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.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setPlacement(Placement placement)
Sets the placement of the symbols.
Gradient reference point 1 x.
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.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
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.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point...
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
A model for displaying SVG files with a preview icon.
const QgsMapUnitScale & displacementXMapUnitScale() const
static const double UI_SCALE_FACTOR
UI scaling factor.
bool exists(const QgsPropertyDefinition &definition) const
Returns true if the property is stored in the layer already, false otherwise.
QString imageFilePath() const
The path to the raster image used for the fill.
QPointF offset() const
Returns the offset for the shapeburst fill.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker's stroke.
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...
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient. Controls how the gradient stops are positioned.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
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.
Qt::PenJoinStyle penJoinStyle() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
GradientSpread gradientSpread() const
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops...
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
A symbol fill consisting of repeated parallel lines.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
QString geometryExpression() const
Gets the expression to generate this geometry.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setColorRamp(QgsColorRamp *ramp)
Sets the color ramp used to draw the shapeburst fill.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image's width.
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
static QgsImageCache * imageCache()
Returns the application's image cache, used for caching resampled versions of raster images...
A simple line symbol layer, which renders lines using a line in a variety of styles (e...
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
Render both exterior and interior rings.
void setAngle(double angle)
Abstract base class for color ramps.
void sourceChanged(const QString &source)
Emitted whenever the file source is changed in the widget.
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
static QIcon symbolPreviewIcon(const QgsSymbol *symbol, QSize size, int padding=0)
Returns an icon preview for a color ramp.
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.
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
const QgsMapUnitScale & strokeWidthMapUnitScale() const
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
QgsUnitTypes::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
void setStrokeColor(const QColor &c) override
Set stroke color.
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
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.
void setStrokeWidth(double width)
Set's the marker's stroke width.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill's offset.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
QColor strokeColor() const override
Returns the marker's stroke color.
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
Place symbols on every vertex in the line.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
double interval() const
Returns the interval between individual symbols.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
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...
QPointF referencePoint1() const
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Tiling is based on complete map viewport.
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)
void setInterval(double interval)
Sets the interval between individual symbols.
virtual double width() const
Returns the estimated width for the line symbol layer.
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.
static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes()
Returns a list of all available shape types.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
QString path() const
Returns the marker SVG path.
QColor strokeColor() const override
Gets stroke color.
void setGradientType(GradientType gradientType)
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
double strokeWidth() const
Returns the width of the marker's stroke.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
void setPath(const QString &path)
Set the marker SVG path.
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern's offset.
void setCoordinateMode(FillCoordinateMode mode)
Set the coordinate mode for fill.
virtual void setColor(const QColor &color)
The fill color.
double offsetY() const
Returns the vertical offset values for points in the pattern.
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows in the pattern.
void setOffset(QPointF offset)
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
QPointF referencePoint2() const
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
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.
const QgsMapUnitScale & distanceMapUnitScale() const
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.
double strokeWidth() const
Raster marker symbol layer class.
A class for filling symbols with a repeated raster image.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols...
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
A dialog to enter a custom dash space pattern for lines.
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
void setStrokeColor(const QColor &color) override
Set stroke color.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
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 offsetX() const
Returns the horizontal offset values for points in the pattern.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
double opacity() const
Returns the marker opacity.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
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 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.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Gradient coordinate mode.
double size() const
Returns the symbol size.
void setOffsetXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0...
Render the interior rings only.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
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.
Line symbol layer type which draws repeating line sections along a line feature.
double displacementX() const
const QgsMapUnitScale & offsetMapUnitScale() const
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 fill's offset.
void setStrokeStyle(Qt::PenStyle strokeStyle)
virtual QColor color() const
The fill color.
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.
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
bool referencePoint2IsCentroid() const
void setSymbolType(QgsSymbol::SymbolType symbolType)
Set the type of symbol which should be created.
double strokeWidth() const
QgsUnitTypes::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
QList< QgsSymbolLayer * > QgsSymbolLayerList
void setStrokeWidth(double w)
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
Shapeburst fill from edge distance.
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
QgsUnitTypes::RenderUnit offsetUnit() const
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
Character, eg for font marker symbol layers.
double offset() const
Returns the line's offset.
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
void setPenJoinStyle(Qt::PenJoinStyle style)
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
QgsSimpleMarkerSymbolLayerBase::Shape shape() const
Returns the shape for the rendered marker symbol.
void setOpacity(double opacity)
Set the marker opacity.
Single scope for storing variables and functions for use within a QgsExpressionContext.
A store for object properties.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
QString path() const
Returns the marker raster image path.
void setHashAngle(double angle)
Sets the angle to use when drawing the hashed lines sections, in degrees clockwise.
Tiling is based on feature bounding box.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols...
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
void setOffset(QPointF offset)
Sets the offset for the fill.
void setPath(const QString &path)
Set the marker raster image path.
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
void setMapUnitScale(const QgsMapUnitScale &scale) FINAL
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
Definition for a property.
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
HorizontalAnchorPoint
Symbol horizontal anchor points.
QString character() const
Returns the character(s) used when rendering points.
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the stroke width.
Gradient reference point 1 y.
Place symbols at regular intervals.
void setStrokeColor(const QColor &strokeColor) override
Set stroke color.
void setOffset(QPointF offset)
Offset for gradient fill.
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)
Sets the pen cap style used to render the line (e.g.
void setDisplacementY(double d)
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.
void sourceChanged(const QString &source)
Emitted whenever the SVG source is changed in the widget.
Qt::BrushStyle brushStyle() const
Line angle, or angle of hash lines for hash line symbols.
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
GradientType gradientType() const
Type of gradient, e.g., linear or radial.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
A model for displaying SVG search paths.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
A class for filling symbols with a repeated SVG file.
Stroke style (eg solid, dashed)
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
double hashAngle() const
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
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 & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
void setShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Sets the rendered marker shape.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
void setGeometryExpression(const QString &exp)
Set the expression to generate this geometry.
void setGradientColorType(GradientColorType gradientColorType)
Line symbol layer type which draws repeating marker symbols along a line feature. ...
Points (e.g., for font sizes)
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache)
Returns the specified path rendered as an image.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0...
void setWidthUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the image's width.
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.
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for lengths used in the custom dash pattern.
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
Shape
Marker symbol shapes.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
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.
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
Qt::PenStyle strokeStyle() const
const QgsMapUnitScale & offsetMapUnitScale() const
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill's stroke.
double strokeWidth() const
Returns the marker's stroke width.
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
Distance between lines, or length of lines for hash line symbols.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit 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...
const QgsMapUnitScale & distanceYMapUnitScale() const
QColor fillColor() const override
Gets fill color.
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
bool pointOnSurface() const
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
void setOffsetX(double offset)
Sets 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 setDistanceY(double d)
QgsSymbol::SymbolType symbolType() const
Access the symbol type.
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...
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
bool referencePoint1IsCentroid() const
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
static const QString EXPR_CLUSTER_SIZE
Inbuilt variable name for cluster size variable.
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features...
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setOffsetYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
double opacity() const
Returns the opacity for the raster image used in the fill.
void setColor2(const QColor &color2)
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
void setAngle(double angle)
Sets the rotation angle for the marker.
Placement placement() const
Returns the placement of the symbols.
Place symbols on the last vertex in the line.
const QgsMapUnitScale & widthMapUnitScale() const
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
void setDistanceX(double d)
Length to average symbol angles over.
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
Render the exterior ring only.
void setBrushStyle(Qt::BrushStyle style)
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
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 fill's offset.
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual symbo...
QColor strokeColor() const override
Gets stroke color.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
Place symbols at the mid point of the line.
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...
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setOpacity(double opacity)
Sets the opacity for the raster image used in the fill.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
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.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
double distance() const
Returns the distance between lines in the fill pattern.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
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.
void setHashLength(double length)
Sets the length of hash symbols.
Fill style (eg solid, dots)
Represents a vector layer which manages a vector based data sets.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical distance between points in the pattern.
double displacementY() const
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
void setDisplacementX(double d)
double width() const
Returns the width used for scaling the image used in the fill.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
Gradient reference point 2 is centroid.
void setGradientSpread(GradientSpread gradientSpread)
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
void setCoordinateMode(GradientCoordinateMode coordinateMode)
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
QgsPropertyDefinition propertyDefinition() const
Returns the underlying property definition.
Gradient reference point 2 x.
void setUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit type used for the dash space pattern (used to update interface labels) ...
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.
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
Property
Data definable properties.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
A dialog to create a new auxiliary field.
void setPointOnSurface(bool pointOnSurface)
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer...
void setOffset(double offset)
Sets the line's offset.
Horizontal distance between points.
QPointF offset() const
Returns the offset for the fill.
virtual QString layerType() const =0
Returns a string that represents this layer type.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr)
Returns a pixmap preview for a color ramp.
Vertical distance between points.