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 *>();
103 for ( QgsUnitSelectionWidget *unitWidget : unitSelectionWidgets )
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 );
1780 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1785 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1792 spinInterval->blockSignals(
true );
1794 spinInterval->blockSignals(
false );
1795 mSpinOffsetAlongLine->blockSignals(
true );
1797 mSpinOffsetAlongLine->blockSignals(
false );
1798 chkRotateMarker->blockSignals(
true );
1800 chkRotateMarker->blockSignals(
false );
1801 spinOffset->blockSignals(
true );
1803 spinOffset->blockSignals(
false );
1805 radInterval->setChecked(
true );
1807 radVertex->setChecked(
true );
1809 radVertexLast->setChecked(
true );
1811 radCentralPoint->setChecked(
true );
1813 radCurvePoint->setChecked(
true );
1815 radSegmentCentralPoint->setChecked(
true );
1817 radVertexFirst->setChecked(
true );
1820 mIntervalUnitWidget->blockSignals(
true );
1823 mIntervalUnitWidget->blockSignals(
false );
1824 mOffsetUnitWidget->blockSignals(
true );
1827 mOffsetUnitWidget->blockSignals(
false );
1828 mOffsetAlongLineUnitWidget->blockSignals(
true );
1831 mOffsetAlongLineUnitWidget->blockSignals(
false );
1865 void QgsMarkerLineSymbolLayerWidget::setRotate()
1867 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1868 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1874 void QgsMarkerLineSymbolLayerWidget::setOffset()
1880 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1882 bool interval = radInterval->isChecked();
1883 spinInterval->setEnabled( interval );
1884 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1885 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
1886 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1887 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1889 if ( radInterval->isChecked() )
1891 else if ( radVertex->isChecked() )
1893 else if ( radVertexLast->isChecked() )
1895 else if ( radVertexFirst->isChecked() )
1897 else if ( radCurvePoint->isChecked() )
1899 else if ( radSegmentCentralPoint->isChecked() )
1907 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
1917 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
1927 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
1937 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
1947 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
1984 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1988 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
1993 spinOffset->setClearValue( 0.0 );
1998 mRingFilterComboBox->hide();
1999 mRingsLabel->hide();
2002 mHashRotationSpinBox->setClearValue( 0 );
2003 mSpinAverageAngleLength->setClearValue( 4.0 );
2005 connect( spinInterval, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2006 connect( mSpinOffsetAlongLine, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2007 connect( mSpinHashLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2008 connect( mHashRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2009 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2010 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2011 connect( mSpinAverageAngleLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2012 connect( radInterval, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2013 connect( radVertex, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2014 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2015 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2016 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2017 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2018 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2023 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2030 spinInterval->blockSignals(
true );
2031 spinInterval->setValue( mLayer->
interval() );
2032 spinInterval->blockSignals(
false );
2033 mSpinOffsetAlongLine->blockSignals(
true );
2035 mSpinOffsetAlongLine->blockSignals(
false );
2038 chkRotateMarker->blockSignals(
true );
2040 chkRotateMarker->blockSignals(
false );
2041 spinOffset->blockSignals(
true );
2042 spinOffset->setValue( mLayer->
offset() );
2043 spinOffset->blockSignals(
false );
2045 radInterval->setChecked(
true );
2047 radVertex->setChecked(
true );
2049 radVertexLast->setChecked(
true );
2051 radCentralPoint->setChecked(
true );
2053 radCurvePoint->setChecked(
true );
2055 radSegmentCentralPoint->setChecked(
true );
2057 radVertexFirst->setChecked(
true );
2060 mIntervalUnitWidget->blockSignals(
true );
2061 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2063 mIntervalUnitWidget->blockSignals(
false );
2064 mOffsetUnitWidget->blockSignals(
true );
2065 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2067 mOffsetUnitWidget->blockSignals(
false );
2068 mOffsetAlongLineUnitWidget->blockSignals(
true );
2071 mOffsetAlongLineUnitWidget->blockSignals(
false );
2078 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2096 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2102 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2108 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2114 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2120 void QgsHashedLineSymbolLayerWidget::setRotate()
2122 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2123 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2129 void QgsHashedLineSymbolLayerWidget::setOffset()
2131 mLayer->
setOffset( spinOffset->value() );
2135 void QgsHashedLineSymbolLayerWidget::setPlacement()
2137 bool interval = radInterval->isChecked();
2138 spinInterval->setEnabled( interval );
2139 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
2140 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2141 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2142 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2144 if ( radInterval->isChecked() )
2146 else if ( radVertex->isChecked() )
2148 else if ( radVertexLast->isChecked() )
2150 else if ( radVertexFirst->isChecked() )
2152 else if ( radCurvePoint->isChecked() )
2154 else if ( radSegmentCentralPoint->isChecked() )
2162 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2172 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2182 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2192 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2202 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2212 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2231 mSvgSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2235 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2236 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2240 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2241 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2248 viewGroups->setHeaderHidden(
true );
2249 mChangeColorButton->setAllowOpacity(
true );
2250 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2251 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2252 mChangeStrokeColorButton->setAllowOpacity(
true );
2253 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2254 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2256 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2257 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2259 spinOffsetX->setClearValue( 0.0 );
2260 spinOffsetY->setClearValue( 0.0 );
2261 spinAngle->setClearValue( 0.0 );
2263 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width( QStringLiteral(
"XXXX" ) ) ) ) );
2264 viewImages->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2268 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2269 connect( viewGroups->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::populateIcons );
2270 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2271 connect( spinHeight, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2273 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2274 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2275 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2284 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2285 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2290 #include <QAbstractListModel> 2291 #include <QPixmapCache> 2297 QAbstractItemModel *oldModel = viewGroups->model();
2299 viewGroups->setModel( g );
2303 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2304 for (
int i = 0; i < rows; i++ )
2306 viewGroups->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2310 oldModel = viewImages->model();
2312 viewImages->setModel( m );
2316 void QgsSvgMarkerSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2318 QString path = idx.data( Qt::UserRole + 1 ).toString();
2320 QAbstractItemModel *oldModel = viewImages->model();
2322 viewImages->setModel( m );
2325 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2336 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2337 QColor defaultFill, defaultStroke;
2338 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2339 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2341 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2342 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2343 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2344 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2345 mChangeColorButton->setEnabled( hasFillParam );
2346 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2347 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2348 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2349 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2354 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2355 if ( hasDefaultFillColor )
2359 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2360 mChangeColorButton->setColor( fill );
2362 if ( hasStrokeParam )
2365 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2366 if ( hasDefaultStrokeColor )
2368 stroke = defaultStroke;
2370 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2371 mChangeStrokeColorButton->setColor( stroke );
2376 mStrokeWidthSpinBox->blockSignals(
true );
2377 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2378 mStrokeWidthSpinBox->blockSignals(
false );
2381 spinHeight->blockSignals(
true );
2382 if ( preservedAspectRatio )
2384 spinHeight->setValue( layer->
size() );
2391 spinHeight->blockSignals(
false );
2392 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2395 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2397 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2399 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2401 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2404 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2415 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2423 QAbstractItemModel *m = viewImages->model();
2424 QItemSelectionModel *selModel = viewImages->selectionModel();
2425 for (
int i = 0; i < m->rowCount(); i++ )
2427 QModelIndex idx( m->index( i, 0 ) );
2428 if ( m->data( idx ).toString() ==
mLayer->
path() )
2430 selModel->select( idx, QItemSelectionModel::SelectCurrent );
2431 selModel->setCurrentIndex( idx, QItemSelectionModel::SelectCurrent );
2437 spinWidth->blockSignals(
true );
2439 spinWidth->blockSignals(
false );
2440 spinAngle->blockSignals(
true );
2442 spinAngle->blockSignals(
false );
2445 spinOffsetX->blockSignals(
true );
2447 spinOffsetX->blockSignals(
false );
2448 spinOffsetY->blockSignals(
true );
2450 spinOffsetY->blockSignals(
false );
2452 mSizeUnitWidget->blockSignals(
true );
2455 mSizeUnitWidget->blockSignals(
false );
2456 mStrokeWidthUnitWidget->blockSignals(
true );
2459 mStrokeWidthUnitWidget->blockSignals(
false );
2460 mOffsetUnitWidget->blockSignals(
true );
2463 mOffsetUnitWidget->blockSignals(
false );
2466 mHorizontalAnchorComboBox->blockSignals(
true );
2467 mVerticalAnchorComboBox->blockSignals(
true );
2470 mHorizontalAnchorComboBox->blockSignals(
false );
2471 mVerticalAnchorComboBox->blockSignals(
false );
2486 updateAssistantSymbol();
2497 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2500 void QgsSvgMarkerSymbolLayerWidget::setName(
const QModelIndex &idx )
2502 QString name = idx.data( Qt::UserRole ).toString();
2510 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2513 double fixedAspectRatio = 0.0;
2514 spinHeight->blockSignals(
true );
2515 if ( defaultAspectRatio <= 0.0 )
2517 spinHeight->setValue( spinWidth->value() );
2519 else if ( mLockAspectRatio->locked() )
2521 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2525 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2527 spinHeight->blockSignals(
false );
2533 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2536 double fixedAspectRatio = 0.0;
2537 spinWidth->blockSignals(
true );
2538 if ( defaultAspectRatio <= 0.0 )
2540 spinWidth->setValue( spinHeight->value() );
2542 else if ( mLockAspectRatio->locked() )
2544 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2548 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2550 spinWidth->blockSignals(
false );
2556 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2560 if ( defaultAspectRatio <= 0.0 )
2576 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2582 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2584 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2588 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2595 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2606 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2617 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2626 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2636 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2646 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2656 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2665 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2680 connect( mTextureWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2682 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2684 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2685 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2692 mSvgTreeView->setHeaderHidden(
true );
2695 mRotationSpinBox->setClearValue( 0.0 );
2697 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2698 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2699 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2700 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2702 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2703 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2705 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2706 connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::populateIcons );
2716 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2725 mTextureWidthSpinBox->blockSignals(
true );
2726 mTextureWidthSpinBox->setValue( width );
2727 mTextureWidthSpinBox->blockSignals(
false );
2729 mRotationSpinBox->blockSignals(
true );
2731 mRotationSpinBox->blockSignals(
false );
2732 mTextureWidthUnitWidget->blockSignals(
true );
2735 mTextureWidthUnitWidget->blockSignals(
false );
2736 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2739 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2740 mChangeColorButton->blockSignals(
true );
2742 mChangeColorButton->blockSignals(
false );
2743 mChangeStrokeColorButton->blockSignals(
true );
2745 mChangeStrokeColorButton->blockSignals(
false );
2746 mStrokeWidthSpinBox->blockSignals(
true );
2748 mStrokeWidthSpinBox->blockSignals(
false );
2768 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2771 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2780 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2792 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex &item )
2794 QString file = item.data( Qt::UserRole ).toString();
2804 QAbstractItemModel *oldModel = mSvgTreeView->model();
2806 mSvgTreeView->setModel( g );
2810 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2811 for (
int i = 0; i < rows; i++ )
2813 mSvgTreeView->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2816 oldModel = mSvgListView->model();
2818 mSvgListView->setModel( m );
2822 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2824 QString path = idx.data( Qt::UserRole + 1 ).toString();
2826 QAbstractItemModel *oldModel = mSvgListView->model();
2828 mSvgListView->setModel( m );
2831 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2835 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2847 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2848 QColor defaultFill, defaultStroke;
2849 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2850 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2852 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2853 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2854 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2855 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2858 QColor fill = mChangeColorButton->color();
2859 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2860 if ( hasDefaultFillColor )
2864 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2865 mChangeColorButton->setColor( fill );
2867 mChangeColorButton->setEnabled( hasFillParam );
2868 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2871 QColor stroke = mChangeStrokeColorButton->color();
2872 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2873 if ( hasDefaultStrokeColor )
2875 stroke = defaultStroke;
2877 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2878 mChangeStrokeColorButton->setColor( stroke );
2880 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2881 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2882 if ( hasDefaultStrokeWidth && resetValues )
2884 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2886 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2889 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2900 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2911 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2920 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2930 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
2946 connect( mAngleSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
2947 connect( mDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
2948 connect( mOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
2955 mOffsetSpinBox->setClearValue( 0 );
2956 mAngleSpinBox->setClearValue( 0 );
2961 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
2970 mAngleSpinBox->blockSignals(
true );
2972 mAngleSpinBox->blockSignals(
false );
2973 mDistanceSpinBox->blockSignals(
true );
2975 mDistanceSpinBox->blockSignals(
false );
2976 mOffsetSpinBox->blockSignals(
true );
2978 mOffsetSpinBox->blockSignals(
false );
2981 mDistanceUnitWidget->blockSignals(
true );
2984 mDistanceUnitWidget->blockSignals(
false );
2985 mOffsetUnitWidget->blockSignals(
true );
2988 mOffsetUnitWidget->blockSignals(
false );
3000 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3009 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3018 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3027 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3037 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3053 connect( mHorizontalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3054 connect( mVerticalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3055 connect( mHorizontalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3056 connect( mVerticalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3057 connect( mHorizontalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3058 connect( mVerticalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3059 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3060 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3061 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3062 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3063 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3064 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3082 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3095 mHorizontalDistanceUnitWidget->blockSignals(
true );
3098 mHorizontalDistanceUnitWidget->blockSignals(
false );
3099 mVerticalDistanceUnitWidget->blockSignals(
true );
3102 mVerticalDistanceUnitWidget->blockSignals(
false );
3103 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3106 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3107 mVerticalDisplacementUnitWidget->blockSignals(
true );
3110 mVerticalDisplacementUnitWidget->blockSignals(
false );
3111 mHorizontalOffsetUnitWidget->blockSignals(
true );
3114 mHorizontalOffsetUnitWidget->blockSignals(
false );
3115 mVerticalOffsetUnitWidget->blockSignals(
true );
3118 mVerticalOffsetUnitWidget->blockSignals(
false );
3133 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3142 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3151 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3160 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3169 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3178 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3187 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3197 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3207 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3217 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3227 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3237 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3258 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3259 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3260 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3270 scrollArea->setVerticalOnly(
true );
3272 btnColor->setAllowOpacity(
true );
3273 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3274 btnColor->setContext( QStringLiteral(
"symbology" ) );
3275 btnStrokeColor->setAllowOpacity(
true );
3276 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3277 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3279 mColorDDBtn->registerLinkedWidget( btnColor );
3280 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3282 spinOffsetX->setClearValue( 0.0 );
3283 spinOffsetY->setClearValue( 0.0 );
3284 spinAngle->setClearValue( 0.0 );
3290 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3294 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3297 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3299 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3300 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3309 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3332 mCharPreview->setFont( layerFont );
3338 mSizeUnitWidget->blockSignals(
true );
3341 mSizeUnitWidget->blockSignals(
false );
3343 mStrokeWidthUnitWidget->blockSignals(
true );
3346 mStrokeWidthUnitWidget->blockSignals(
false );
3348 mOffsetUnitWidget->blockSignals(
true );
3351 mOffsetUnitWidget->blockSignals(
false );
3370 updateAssistantSymbol();
3382 mCharPreview->setFont( font );
3413 mCharPreview->setText( text );
3415 if ( text.isEmpty() )
3419 QString character = text;
3420 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3423 unsigned int value = text.toUInt( &ok, 0 );
3426 character = QChar( value );
3427 mCharPreview->setText( character );
3448 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3450 mCharLineEdit->insert( chr );
3456 mCharPreview->setText( chr );
3460 void QgsFontMarkerSymbolLayerWidget::setOffset()
3462 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3466 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3472 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3482 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3492 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3502 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3511 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3520 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3529 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3531 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3533 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3535 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3538 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3550 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3551 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3556 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3572 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3578 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3593 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3597 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3599 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3600 connect( mHeightSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3608 mSpinOffsetX->setClearValue( 0.0 );
3609 mSpinOffsetY->setClearValue( 0.0 );
3610 mRotationSpinBox->setClearValue( 0.0 );
3612 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3613 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3616 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3617 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3627 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3638 mHeightSpinBox->blockSignals(
true );
3639 if ( preservedAspectRatio )
3648 mHeightSpinBox->blockSignals(
false );
3649 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3657 mSizeUnitWidget->blockSignals(
true );
3660 mSizeUnitWidget->blockSignals(
false );
3661 mOffsetUnitWidget->blockSignals(
true );
3664 mOffsetUnitWidget->blockSignals(
false );
3679 updatePreviewImage();
3690 mImageSourceLineEdit->setMessageBar( context.
messageBar() );
3693 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3696 updatePreviewImage();
3700 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3702 bool fitsInCache =
false;
3704 if ( image.isNull() )
3706 mLabelImagePreview->setPixmap( QPixmap() );
3710 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3711 previewImage.fill( Qt::transparent );
3712 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3714 p.begin( &previewImage );
3716 uchar pixDataRGB[] = { 150, 150, 150, 150,
3721 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3722 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3723 QBrush checkerBrush;
3724 checkerBrush.setTexture( pix );
3725 p.fillRect( imageRect, checkerBrush );
3732 p.drawImage( imageRect.left(), imageRect.top(), image );
3734 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3737 void QgsRasterMarkerSymbolLayerWidget::setWidth()
3740 double fixedAspectRatio = 0.0;
3741 mHeightSpinBox->blockSignals(
true );
3742 if ( defaultAspectRatio <= 0.0 )
3744 mHeightSpinBox->setValue( mWidthSpinBox->value() );
3746 else if ( mLockAspectRatio->locked() )
3748 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
3752 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3754 mHeightSpinBox->blockSignals(
false );
3760 void QgsRasterMarkerSymbolLayerWidget::setHeight()
3763 double fixedAspectRatio = 0.0;
3764 mWidthSpinBox->blockSignals(
true );
3765 if ( defaultAspectRatio <= 0.0 )
3767 mWidthSpinBox->setValue( mHeightSpinBox->value() );
3769 else if ( mLockAspectRatio->locked() )
3771 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
3775 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3777 mWidthSpinBox->blockSignals(
false );
3783 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
3786 if ( defaultAspectRatio <= 0.0 )
3801 void QgsRasterMarkerSymbolLayerWidget::setAngle()
3807 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
3811 updatePreviewImage();
3814 void QgsRasterMarkerSymbolLayerWidget::setOffset()
3816 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3820 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3830 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3840 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3849 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3866 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3870 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
3872 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
3879 mSpinOffsetX->setClearValue( 0.0 );
3880 mSpinOffsetY->setClearValue( 0.0 );
3881 mRotationSpinBox->setClearValue( 0.0 );
3883 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
3884 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3885 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3897 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
3910 cboCoordinateMode->blockSignals(
true );
3914 cboCoordinateMode->setCurrentIndex( 1 );
3918 cboCoordinateMode->setCurrentIndex( 0 );
3921 cboCoordinateMode->blockSignals(
false );
3927 mOffsetUnitWidget->blockSignals(
true );
3930 mOffsetUnitWidget->blockSignals(
false );
3933 mWidthUnitWidget->blockSignals(
true );
3936 mWidthUnitWidget->blockSignals(
false );
3938 updatePreviewImage();
3951 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
3954 updatePreviewImage();
3958 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
3975 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
3984 updatePreviewImage();
3987 void QgsRasterFillSymbolLayerWidget::offsetChanged()
3989 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3993 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4004 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4013 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4024 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4034 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4036 bool fitsInCache =
false;
4038 if ( image.isNull() )
4040 mLabelImagePreview->setPixmap( QPixmap() );
4044 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4045 previewImage.fill( Qt::transparent );
4046 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4048 p.begin( &previewImage );
4050 uchar pixDataRGB[] = { 150, 150, 150, 150,
4055 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4056 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4057 QBrush checkerBrush;
4058 checkerBrush.setTexture( pix );
4059 p.fillRect( imageRect, checkerBrush );
4066 p.drawImage( imageRect.left(), imageRect.top(), image );
4068 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4077 modificationExpressionSelector->setMultiLine(
true );
4078 modificationExpressionSelector->setLayer( const_cast<QgsVectorLayer *>( vl ) );
4079 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4084 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4091 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
4099 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4106 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4108 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 containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasStrokeParam, QColor &defaultStrokeColor, bool &hasStrokeWidthParam, double &defaultStrokeWidth, bool blocking=false) const
Tests if an svg file contains parameters for fill, stroke color, stroke width.
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.
Place symbols at the center of every line segment.
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 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.
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.
static QPixmap symbolPreviewPixmap(const QgsSymbol *symbol, QSize size, int padding=0, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr)
Returns a pixmap preview for a color ramp.
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.
QImage pathAsImage(const QString &path, const QSize size, const bool keepAspectRatio, const double opacity, bool &fitsInCache, bool blocking=false)
Returns the specified path rendered as an image.
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...
Vertical distance between points.