48 #include <QAbstractButton>
49 #include <QButtonGroup>
50 #include <QColorDialog>
53 #include <QFileDialog>
55 #include <QStandardItemModel>
56 #include <QSvgRenderer>
57 #include <QMessageBox>
60 #include <QInputDialog>
76 expContext << symbolScope;
100 << QStringLiteral(
"symbol_layer_count" ) << QStringLiteral(
"symbol_layer_index" ) );
108 const auto unitSelectionWidgets = findChildren<QgsUnitSelectionWidget *>();
109 for ( QgsUnitSelectionWidget *unitWidget : unitSelectionWidgets )
111 unitWidget->setMapCanvas( mContext.
mapCanvas() );
129 void QgsSymbolLayerWidget::createAuxiliaryField()
150 if ( dlg.exec() == QDialog::Accepted )
151 def = dlg.propertyDefinition();
161 property.setActive(
true );
183 connect( mCustomCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged );
184 connect( mChangePatternButton, &QPushButton::clicked,
this, &QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked );
188 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
196 btnChangeColor->setAllowOpacity(
true );
197 btnChangeColor->setColorDialogTitle( tr(
"Select Line Color" ) );
198 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
200 mColorDDBtn->registerLinkedWidget( btnChangeColor );
205 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
214 spinOffset->setClearValue( 0.0 );
219 mDrawInsideCheckBox->hide();
220 mRingFilterComboBox->hide();
228 mPenWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
230 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penWidthChanged );
232 connect( cboPenStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
233 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleLineSymbolLayerWidget::offsetChanged );
234 connect( cboCapStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
235 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleLineSymbolLayerWidget::penStyleChanged );
242 void QgsSimpleLineSymbolLayerWidget::updateAssistantSymbol()
244 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
246 mAssistantPreviewSymbol->deleteSymbolLayer( i );
248 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
251 mAssistantPreviewSymbol->setDataDefinedWidth( ddWidth );
257 if ( !layer || layer->
layerType() != QLatin1String(
"SimpleLine" ) )
264 mPenWidthUnitWidget->blockSignals(
true );
267 mPenWidthUnitWidget->blockSignals(
false );
268 mOffsetUnitWidget->blockSignals(
true );
271 mOffsetUnitWidget->blockSignals(
false );
272 mDashPatternUnitWidget->blockSignals(
true );
276 mDashPatternUnitWidget->blockSignals(
false );
279 spinWidth->blockSignals(
true );
281 spinWidth->blockSignals(
false );
282 btnChangeColor->blockSignals(
true );
284 btnChangeColor->blockSignals(
false );
285 spinOffset->blockSignals(
true );
287 spinOffset->blockSignals(
false );
288 cboPenStyle->blockSignals(
true );
289 cboJoinStyle->blockSignals(
true );
290 cboCapStyle->blockSignals(
true );
294 cboPenStyle->blockSignals(
false );
295 cboJoinStyle->blockSignals(
false );
296 cboCapStyle->blockSignals(
false );
300 mChangePatternButton->setEnabled( useCustomDashPattern );
301 label_3->setEnabled( !useCustomDashPattern );
302 cboPenStyle->setEnabled( !useCustomDashPattern );
303 mCustomCheckBox->blockSignals(
true );
304 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
305 mCustomCheckBox->blockSignals(
false );
308 QSize size = mChangePatternButton->minimumSizeHint();
310 mChangePatternButton->setMinimumSize( QSize( size.width(), std::max( size.height(), fontHeight ) ) );
314 whileBlocking( mDrawInsideCheckBox )->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
328 updateAssistantSymbol();
336 void QgsSimpleLineSymbolLayerWidget::penWidthChanged()
343 void QgsSimpleLineSymbolLayerWidget::colorChanged(
const QColor &color )
349 void QgsSimpleLineSymbolLayerWidget::penStyleChanged()
358 void QgsSimpleLineSymbolLayerWidget::offsetChanged()
365 void QgsSimpleLineSymbolLayerWidget::mCustomCheckBox_stateChanged(
int state )
367 bool checked = ( state == Qt::Checked );
368 mChangePatternButton->setEnabled( checked );
369 label_3->setEnabled( !checked );
370 cboPenStyle->setEnabled( !checked );
376 void QgsSimpleLineSymbolLayerWidget::mChangePatternButton_clicked()
383 widget->
setUnit( mDashPatternUnitWidget->unit() );
395 d.setUnit( mDashPatternUnitWidget->unit() );
396 if ( d.exec() == QDialog::Accepted )
404 void QgsSimpleLineSymbolLayerWidget::mPenWidthUnitWidget_changed()
415 void QgsSimpleLineSymbolLayerWidget::mOffsetUnitWidget_changed()
425 void QgsSimpleLineSymbolLayerWidget::mDashPatternUnitWidget_changed()
436 void QgsSimpleLineSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
438 bool checked = ( state == Qt::Checked );
450 std::unique_ptr< QgsSimpleLineSymbolLayer > layerCopy(
mLayer->
clone() );
455 QColor color = qApp->palette().color( QPalette::WindowText );
456 layerCopy->setColor( color );
458 layerCopy->setOffset( 0 );
459 layerCopy->setUseCustomDashPattern(
true );
461 QSize currentIconSize;
464 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 6 );
466 currentIconSize = QSize( mChangePatternButton->width() - 10, mChangePatternButton->height() - 12 );
469 if ( !currentIconSize.isValid() || currentIconSize.width() <= 0 || currentIconSize.height() <= 0 )
475 std::unique_ptr< QgsLineSymbol > previewSymbol = qgis::make_unique< QgsLineSymbol >(
QgsSymbolLayerList() << layerCopy.release() );
477 mChangePatternButton->setIconSize( currentIconSize );
478 mChangePatternButton->setIcon( icon );
482 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
485 int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
487 int height =
static_cast< int >( width / 1.61803398875 );
491 QBuffer buffer( &data );
492 pm.save( &buffer,
"PNG", 100 );
493 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
498 QgsSymbolLayerWidget::resizeEvent( event );
516 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
517 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
518 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
519 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
527 btnChangeColorFill->setAllowOpacity(
true );
528 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
529 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
530 btnChangeColorFill->setShowNoColor(
true );
531 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
532 btnChangeColorStroke->setAllowOpacity(
true );
533 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
534 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
535 btnChangeColorStroke->setShowNoColor(
true );
536 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
538 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
539 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
541 spinOffsetX->setClearValue( 0.0 );
542 spinOffsetY->setClearValue( 0.0 );
543 spinAngle->setClearValue( 0.0 );
549 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
551 int size = lstNames->iconSize().width();
553 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
554 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
556 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
559 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
560 lstNames->setIconSize( QSize( size, size ) );
562 double markerSize = size * 0.8;
568 lyr->
setColor( QColor( 200, 200, 200 ) );
571 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
572 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
577 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
579 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
582 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
583 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
584 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
585 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
586 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
592 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
600 for (
int i = 0; i < lstNames->count(); ++i )
604 lstNames->setCurrentRow( i );
608 btnChangeColorStroke->blockSignals(
true );
610 btnChangeColorStroke->blockSignals(
false );
611 btnChangeColorFill->blockSignals(
true );
614 btnChangeColorFill->blockSignals(
false );
615 spinSize->blockSignals(
true );
617 spinSize->blockSignals(
false );
618 spinAngle->blockSignals(
true );
620 spinAngle->blockSignals(
false );
621 mStrokeStyleComboBox->blockSignals(
true );
623 mStrokeStyleComboBox->blockSignals(
false );
624 mStrokeWidthSpinBox->blockSignals(
true );
626 mStrokeWidthSpinBox->blockSignals(
false );
627 cboJoinStyle->blockSignals(
true );
629 cboJoinStyle->blockSignals(
false );
632 spinOffsetX->blockSignals(
true );
634 spinOffsetX->blockSignals(
false );
635 spinOffsetY->blockSignals(
true );
637 spinOffsetY->blockSignals(
false );
639 mSizeUnitWidget->blockSignals(
true );
642 mSizeUnitWidget->blockSignals(
false );
643 mOffsetUnitWidget->blockSignals(
true );
646 mOffsetUnitWidget->blockSignals(
false );
647 mStrokeWidthUnitWidget->blockSignals(
true );
650 mStrokeWidthUnitWidget->blockSignals(
false );
653 mHorizontalAnchorComboBox->blockSignals(
true );
654 mVerticalAnchorComboBox->blockSignals(
true );
657 mHorizontalAnchorComboBox->blockSignals(
false );
658 mVerticalAnchorComboBox->blockSignals(
false );
672 updateAssistantSymbol();
680 void QgsSimpleMarkerSymbolLayerWidget::setShape()
699 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
705 void QgsSimpleMarkerSymbolLayerWidget::setSize()
711 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
717 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
719 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
723 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
734 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
743 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
753 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
763 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
773 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
782 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
791 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
793 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
795 mAssistantPreviewSymbol->deleteSymbolLayer( i );
797 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
800 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
819 btnChangeColor->setAllowOpacity(
true );
820 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
821 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
822 btnChangeColor->setShowNoColor(
true );
823 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
824 btnChangeStrokeColor->setAllowOpacity(
true );
825 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
826 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
827 btnChangeStrokeColor->setShowNoColor(
true );
828 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
830 spinOffsetX->setClearValue( 0.0 );
831 spinOffsetY->setClearValue( 0.0 );
834 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
836 connect( spinStrokeWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
837 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
838 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
839 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
840 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
842 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
843 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
848 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
855 btnChangeColor->blockSignals(
true );
857 btnChangeColor->blockSignals(
false );
858 cboFillStyle->blockSignals(
true );
860 cboFillStyle->blockSignals(
false );
861 btnChangeStrokeColor->blockSignals(
true );
863 btnChangeStrokeColor->blockSignals(
false );
864 cboStrokeStyle->blockSignals(
true );
866 cboStrokeStyle->blockSignals(
false );
867 spinStrokeWidth->blockSignals(
true );
869 spinStrokeWidth->blockSignals(
false );
870 cboJoinStyle->blockSignals(
true );
872 cboJoinStyle->blockSignals(
false );
873 spinOffsetX->blockSignals(
true );
875 spinOffsetX->blockSignals(
false );
876 spinOffsetY->blockSignals(
true );
878 spinOffsetY->blockSignals(
false );
880 mStrokeWidthUnitWidget->blockSignals(
true );
883 mStrokeWidthUnitWidget->blockSignals(
false );
884 mOffsetUnitWidget->blockSignals(
true );
887 mOffsetUnitWidget->blockSignals(
false );
915 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
921 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
927 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
934 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
936 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
940 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
950 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
970 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
971 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
977 spinOffsetX->setClearValue( 0.0 );
978 spinOffsetY->setClearValue( 0.0 );
979 spinAngle->setClearValue( 0.0 );
985 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
987 int size = lstNames->iconSize().width();
988 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
989 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
991 size = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
993 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
994 lstNames->setIconSize( QSize( size, size ) );
996 double markerSize = size * 0.8;
1002 lyr->
setColor( QColor( 200, 200, 200 ) );
1005 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1006 item->setData( Qt::UserRole,
static_cast< int >( shape ) );
1011 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1013 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1014 connect( spinSize,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1015 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1016 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1017 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1023 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1031 for (
int i = 0; i < lstNames->count(); ++i )
1035 lstNames->setCurrentRow( i );
1044 mSizeUnitWidget->blockSignals(
true );
1047 mSizeUnitWidget->blockSignals(
false );
1048 mOffsetUnitWidget->blockSignals(
true );
1051 mOffsetUnitWidget->blockSignals(
false );
1064 updateAssistantSymbol();
1072 void QgsFilledMarkerSymbolLayerWidget::setShape()
1078 void QgsFilledMarkerSymbolLayerWidget::setSize()
1084 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1090 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1092 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1096 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1106 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1116 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1125 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1134 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1136 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1138 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1140 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1143 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1156 connect( mSpinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1160 btnColorRamp->setShowGradientOnly(
true );
1162 btnChangeColor->setAllowOpacity(
true );
1163 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1164 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1165 btnChangeColor->setShowNoColor(
true );
1166 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1167 btnChangeColor2->setAllowOpacity(
true );
1168 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1169 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1170 btnChangeColor2->setShowNoColor(
true );
1171 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1173 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1174 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1176 spinOffsetX->setClearValue( 0.0 );
1177 spinOffsetY->setClearValue( 0.0 );
1178 mSpinAngle->setClearValue( 0.0 );
1186 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1187 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1188 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1189 connect( spinRefPoint1X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1190 connect( spinRefPoint1Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1191 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1192 connect( spinRefPoint2X,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1193 connect( spinRefPoint2Y,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1194 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1199 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1206 btnChangeColor->blockSignals(
true );
1208 btnChangeColor->blockSignals(
false );
1209 btnChangeColor2->blockSignals(
true );
1211 btnChangeColor2->blockSignals(
false );
1215 radioTwoColor->setChecked(
true );
1216 btnColorRamp->setEnabled(
false );
1220 radioColorRamp->setChecked(
true );
1221 btnChangeColor->setEnabled(
false );
1222 btnChangeColor2->setEnabled(
false );
1228 btnColorRamp->blockSignals(
true );
1230 btnColorRamp->blockSignals(
false );
1233 cboGradientType->blockSignals(
true );
1237 cboGradientType->setCurrentIndex( 0 );
1240 cboGradientType->setCurrentIndex( 1 );
1243 cboGradientType->setCurrentIndex( 2 );
1246 cboGradientType->blockSignals(
false );
1248 cboCoordinateMode->blockSignals(
true );
1252 cboCoordinateMode->setCurrentIndex( 1 );
1253 checkRefPoint1Centroid->setEnabled(
false );
1254 checkRefPoint2Centroid->setEnabled(
false );
1258 cboCoordinateMode->setCurrentIndex( 0 );
1261 cboCoordinateMode->blockSignals(
false );
1263 cboGradientSpread->blockSignals(
true );
1267 cboGradientSpread->setCurrentIndex( 0 );
1270 cboGradientSpread->setCurrentIndex( 1 );
1273 cboGradientSpread->setCurrentIndex( 2 );
1276 cboGradientSpread->blockSignals(
false );
1278 spinRefPoint1X->blockSignals(
true );
1280 spinRefPoint1X->blockSignals(
false );
1281 spinRefPoint1Y->blockSignals(
true );
1283 spinRefPoint1Y->blockSignals(
false );
1284 checkRefPoint1Centroid->blockSignals(
true );
1288 spinRefPoint1X->setEnabled(
false );
1289 spinRefPoint1Y->setEnabled(
false );
1291 checkRefPoint1Centroid->blockSignals(
false );
1292 spinRefPoint2X->blockSignals(
true );
1294 spinRefPoint2X->blockSignals(
false );
1295 spinRefPoint2Y->blockSignals(
true );
1297 spinRefPoint2Y->blockSignals(
false );
1298 checkRefPoint2Centroid->blockSignals(
true );
1302 spinRefPoint2X->setEnabled(
false );
1303 spinRefPoint2Y->setEnabled(
false );
1305 checkRefPoint2Centroid->blockSignals(
false );
1307 spinOffsetX->blockSignals(
true );
1309 spinOffsetX->blockSignals(
false );
1310 spinOffsetY->blockSignals(
true );
1312 spinOffsetY->blockSignals(
false );
1313 mSpinAngle->blockSignals(
true );
1315 mSpinAngle->blockSignals(
false );
1317 mOffsetUnitWidget->blockSignals(
true );
1320 mOffsetUnitWidget->blockSignals(
false );
1353 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1355 if ( radioTwoColor->isChecked() )
1368 if ( btnColorRamp->isNull() )
1382 spinRefPoint1X->setValue( 0.5 );
1383 spinRefPoint1Y->setValue( 0 );
1384 spinRefPoint2X->setValue( 0.5 );
1385 spinRefPoint2Y->setValue( 1 );
1390 spinRefPoint1X->setValue( 0 );
1391 spinRefPoint1Y->setValue( 0 );
1392 spinRefPoint2X->setValue( 1 );
1393 spinRefPoint2Y->setValue( 1 );
1397 spinRefPoint1X->setValue( 0.5 );
1398 spinRefPoint1Y->setValue( 0.5 );
1399 spinRefPoint2X->setValue( 1 );
1400 spinRefPoint2Y->setValue( 1 );
1415 checkRefPoint1Centroid->setEnabled(
true );
1416 checkRefPoint2Centroid->setEnabled(
true );
1422 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1423 checkRefPoint1Centroid->setEnabled(
false );
1424 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1425 checkRefPoint2Centroid->setEnabled(
false );
1450 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1452 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1456 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1465 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1471 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1489 connect( mSpinBlurRadius, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1490 connect( mSpinMaxDistance, qgis::overload< double >::of( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1492 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1494 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1500 QButtonGroup *group1 =
new QButtonGroup(
this );
1501 group1->addButton( radioColorRamp );
1502 group1->addButton( radioTwoColor );
1503 QButtonGroup *group2 =
new QButtonGroup(
this );
1504 group2->addButton( mRadioUseMaxDistance );
1505 group2->addButton( mRadioUseWholeShape );
1506 btnChangeColor->setAllowOpacity(
true );
1507 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1508 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1509 btnChangeColor->setShowNoColor(
true );
1510 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1511 btnChangeColor2->setAllowOpacity(
true );
1512 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1513 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1514 btnChangeColor2->setShowNoColor(
true );
1515 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1517 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1518 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1520 spinOffsetX->setClearValue( 0.0 );
1521 spinOffsetY->setClearValue( 0.0 );
1523 btnColorRamp->setShowGradientOnly(
true );
1529 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1530 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1531 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1533 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1534 connect( mSpinBlurRadius,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1539 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1546 btnChangeColor->blockSignals(
true );
1548 btnChangeColor->blockSignals(
false );
1549 btnChangeColor2->blockSignals(
true );
1551 btnChangeColor2->blockSignals(
false );
1555 radioTwoColor->setChecked(
true );
1556 btnColorRamp->setEnabled(
false );
1560 radioColorRamp->setChecked(
true );
1561 btnChangeColor->setEnabled(
false );
1562 btnChangeColor2->setEnabled(
false );
1565 mSpinBlurRadius->blockSignals(
true );
1566 mBlurSlider->blockSignals(
true );
1569 mSpinBlurRadius->blockSignals(
false );
1570 mBlurSlider->blockSignals(
false );
1572 mSpinMaxDistance->blockSignals(
true );
1574 mSpinMaxDistance->blockSignals(
false );
1576 mRadioUseWholeShape->blockSignals(
true );
1577 mRadioUseMaxDistance->blockSignals(
true );
1580 mRadioUseWholeShape->setChecked(
true );
1581 mSpinMaxDistance->setEnabled(
false );
1582 mDistanceUnitWidget->setEnabled(
false );
1586 mRadioUseMaxDistance->setChecked(
true );
1587 mSpinMaxDistance->setEnabled(
true );
1588 mDistanceUnitWidget->setEnabled(
true );
1590 mRadioUseWholeShape->blockSignals(
false );
1591 mRadioUseMaxDistance->blockSignals(
false );
1593 mDistanceUnitWidget->blockSignals(
true );
1596 mDistanceUnitWidget->blockSignals(
false );
1598 mIgnoreRingsCheckBox->blockSignals(
true );
1599 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1600 mIgnoreRingsCheckBox->blockSignals(
false );
1605 btnColorRamp->blockSignals(
true );
1607 btnColorRamp->blockSignals(
false );
1610 spinOffsetX->blockSignals(
true );
1612 spinOffsetX->blockSignals(
false );
1613 spinOffsetY->blockSignals(
true );
1615 spinOffsetY->blockSignals(
false );
1616 mOffsetUnitWidget->blockSignals(
true );
1619 mOffsetUnitWidget->blockSignals(
false );
1652 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1659 if ( radioTwoColor->isChecked() )
1670 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1679 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1688 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1698 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1703 mDistanceUnitWidget->setEnabled( !value );
1708 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1718 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1722 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1727 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1738 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1740 bool checked = ( state == Qt::Checked );
1769 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1778 spinOffset->setClearValue( 0.0 );
1783 mRingFilterComboBox->hide();
1784 mRingsLabel->hide();
1787 mSpinAverageAngleLength->setClearValue( 4.0 );
1791 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1792 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1793 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1794 connect( radInterval, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1795 connect( radVertex, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1796 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1797 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1798 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1799 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1800 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1805 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1812 spinInterval->blockSignals(
true );
1814 spinInterval->blockSignals(
false );
1815 mSpinOffsetAlongLine->blockSignals(
true );
1817 mSpinOffsetAlongLine->blockSignals(
false );
1818 chkRotateMarker->blockSignals(
true );
1820 chkRotateMarker->blockSignals(
false );
1821 spinOffset->blockSignals(
true );
1823 spinOffset->blockSignals(
false );
1825 radInterval->setChecked(
true );
1827 radVertex->setChecked(
true );
1829 radVertexLast->setChecked(
true );
1831 radCentralPoint->setChecked(
true );
1833 radCurvePoint->setChecked(
true );
1835 radSegmentCentralPoint->setChecked(
true );
1837 radVertexFirst->setChecked(
true );
1840 mIntervalUnitWidget->blockSignals(
true );
1843 mIntervalUnitWidget->blockSignals(
false );
1844 mOffsetUnitWidget->blockSignals(
true );
1847 mOffsetUnitWidget->blockSignals(
false );
1848 mOffsetAlongLineUnitWidget->blockSignals(
true );
1851 mOffsetAlongLineUnitWidget->blockSignals(
false );
1885 void QgsMarkerLineSymbolLayerWidget::setRotate()
1887 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1888 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1894 void QgsMarkerLineSymbolLayerWidget::setOffset()
1900 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1902 bool interval = radInterval->isChecked();
1903 spinInterval->setEnabled( interval );
1904 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1905 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
1906 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1907 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1909 if ( radInterval->isChecked() )
1911 else if ( radVertex->isChecked() )
1913 else if ( radVertexLast->isChecked() )
1915 else if ( radVertexFirst->isChecked() )
1917 else if ( radCurvePoint->isChecked() )
1919 else if ( radSegmentCentralPoint->isChecked() )
1927 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
1937 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
1947 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
1957 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
1967 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
2004 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2013 spinOffset->setClearValue( 0.0 );
2018 mRingFilterComboBox->hide();
2019 mRingsLabel->hide();
2022 mHashRotationSpinBox->setClearValue( 0 );
2023 mSpinAverageAngleLength->setClearValue( 4.0 );
2025 connect( spinInterval,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2026 connect( mSpinOffsetAlongLine,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2027 connect( mSpinHashLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2028 connect( mHashRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2029 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2030 connect( spinOffset,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2031 connect( mSpinAverageAngleLength,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2032 connect( radInterval, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2033 connect( radVertex, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2034 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2035 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2036 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2037 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2038 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2043 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2050 spinInterval->blockSignals(
true );
2051 spinInterval->setValue( mLayer->
interval() );
2052 spinInterval->blockSignals(
false );
2053 mSpinOffsetAlongLine->blockSignals(
true );
2055 mSpinOffsetAlongLine->blockSignals(
false );
2058 chkRotateMarker->blockSignals(
true );
2060 chkRotateMarker->blockSignals(
false );
2061 spinOffset->blockSignals(
true );
2062 spinOffset->setValue( mLayer->
offset() );
2063 spinOffset->blockSignals(
false );
2065 radInterval->setChecked(
true );
2067 radVertex->setChecked(
true );
2069 radVertexLast->setChecked(
true );
2071 radCentralPoint->setChecked(
true );
2073 radCurvePoint->setChecked(
true );
2075 radSegmentCentralPoint->setChecked(
true );
2077 radVertexFirst->setChecked(
true );
2080 mIntervalUnitWidget->blockSignals(
true );
2081 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2083 mIntervalUnitWidget->blockSignals(
false );
2084 mOffsetUnitWidget->blockSignals(
true );
2085 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2087 mOffsetUnitWidget->blockSignals(
false );
2088 mOffsetAlongLineUnitWidget->blockSignals(
true );
2091 mOffsetAlongLineUnitWidget->blockSignals(
false );
2098 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2116 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2122 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2128 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2134 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2140 void QgsHashedLineSymbolLayerWidget::setRotate()
2142 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2143 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2149 void QgsHashedLineSymbolLayerWidget::setOffset()
2151 mLayer->
setOffset( spinOffset->value() );
2155 void QgsHashedLineSymbolLayerWidget::setPlacement()
2157 bool interval = radInterval->isChecked();
2158 spinInterval->setEnabled( interval );
2159 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
2160 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2161 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2162 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2164 if ( radInterval->isChecked() )
2166 else if ( radVertex->isChecked() )
2168 else if ( radVertexLast->isChecked() )
2170 else if ( radVertexFirst->isChecked() )
2172 else if ( radCurvePoint->isChecked() )
2174 else if ( radSegmentCentralPoint->isChecked() )
2182 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2192 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2202 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2212 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2222 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2232 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2251 mSvgSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2255 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2256 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2260 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2261 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2268 viewGroups->setHeaderHidden(
true );
2269 mChangeColorButton->setAllowOpacity(
true );
2270 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2271 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2272 mChangeStrokeColorButton->setAllowOpacity(
true );
2273 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2274 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2276 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2277 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2279 spinOffsetX->setClearValue( 0.0 );
2280 spinOffsetY->setClearValue( 0.0 );
2281 spinAngle->setClearValue( 0.0 );
2283 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
2284 mIconSize = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 4 ) ) );
2286 mIconSize = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 4 ) ) );
2288 viewImages->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2292 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2293 connect( viewGroups->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::populateIcons );
2294 connect( spinWidth,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2295 connect( spinHeight,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2297 connect( spinAngle,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2298 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2299 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2308 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2309 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2314 #include <QAbstractListModel>
2315 #include <QPixmapCache>
2321 QAbstractItemModel *oldModel = viewGroups->model();
2323 viewGroups->setModel( g );
2327 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2328 for (
int i = 0; i < rows; i++ )
2330 viewGroups->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2334 oldModel = viewImages->model();
2336 viewImages->setModel( m );
2340 void QgsSvgMarkerSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2342 QString path = idx.data( Qt::UserRole + 1 ).toString();
2344 QAbstractItemModel *oldModel = viewImages->model();
2346 viewImages->setModel( m );
2349 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2360 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2361 QColor defaultFill, defaultStroke;
2362 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2363 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2365 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2366 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2367 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2368 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2369 mChangeColorButton->setEnabled( hasFillParam );
2370 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2371 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2372 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2373 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2378 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2379 if ( hasDefaultFillColor )
2383 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2384 mChangeColorButton->setColor( fill );
2386 if ( hasStrokeParam )
2389 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2390 if ( hasDefaultStrokeColor )
2392 stroke = defaultStroke;
2394 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2395 mChangeStrokeColorButton->setColor( stroke );
2400 mStrokeWidthSpinBox->blockSignals(
true );
2401 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2402 mStrokeWidthSpinBox->blockSignals(
false );
2405 spinHeight->blockSignals(
true );
2406 if ( preservedAspectRatio )
2408 spinHeight->setValue( layer->
size() );
2415 spinHeight->blockSignals(
false );
2416 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2419 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2421 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2423 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2425 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2428 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2439 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2447 QAbstractItemModel *m = viewImages->model();
2448 QItemSelectionModel *selModel = viewImages->selectionModel();
2449 for (
int i = 0; i < m->rowCount(); i++ )
2451 QModelIndex idx( m->index( i, 0 ) );
2452 if ( m->data( idx ).toString() ==
mLayer->
path() )
2454 selModel->select( idx, QItemSelectionModel::SelectCurrent );
2455 selModel->setCurrentIndex( idx, QItemSelectionModel::SelectCurrent );
2461 spinWidth->blockSignals(
true );
2463 spinWidth->blockSignals(
false );
2464 spinAngle->blockSignals(
true );
2466 spinAngle->blockSignals(
false );
2469 spinOffsetX->blockSignals(
true );
2471 spinOffsetX->blockSignals(
false );
2472 spinOffsetY->blockSignals(
true );
2474 spinOffsetY->blockSignals(
false );
2476 mSizeUnitWidget->blockSignals(
true );
2479 mSizeUnitWidget->blockSignals(
false );
2480 mStrokeWidthUnitWidget->blockSignals(
true );
2483 mStrokeWidthUnitWidget->blockSignals(
false );
2484 mOffsetUnitWidget->blockSignals(
true );
2487 mOffsetUnitWidget->blockSignals(
false );
2490 mHorizontalAnchorComboBox->blockSignals(
true );
2491 mVerticalAnchorComboBox->blockSignals(
true );
2494 mHorizontalAnchorComboBox->blockSignals(
false );
2495 mVerticalAnchorComboBox->blockSignals(
false );
2510 updateAssistantSymbol();
2524 void QgsSvgMarkerSymbolLayerWidget::setName(
const QModelIndex &idx )
2526 QString name = idx.data( Qt::UserRole ).toString();
2534 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2537 double fixedAspectRatio = 0.0;
2538 spinHeight->blockSignals(
true );
2539 if ( defaultAspectRatio <= 0.0 )
2541 spinHeight->setValue( spinWidth->value() );
2543 else if ( mLockAspectRatio->locked() )
2545 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2549 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2551 spinHeight->blockSignals(
false );
2557 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2560 double fixedAspectRatio = 0.0;
2561 spinWidth->blockSignals(
true );
2562 if ( defaultAspectRatio <= 0.0 )
2564 spinWidth->setValue( spinHeight->value() );
2566 else if ( mLockAspectRatio->locked() )
2568 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2572 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2574 spinWidth->blockSignals(
false );
2580 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2584 if ( defaultAspectRatio <= 0.0 )
2600 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2606 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2608 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2612 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2619 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2630 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2641 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2650 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2660 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2670 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2680 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2689 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2704 connect( mTextureWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2706 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2708 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2709 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2716 mSvgTreeView->setHeaderHidden(
true );
2718 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
2719 mIconSize = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 4 ) ) );
2721 mIconSize = std::max( 30,
static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 4 ) ) );
2723 mSvgListView->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2727 mRotationSpinBox->setClearValue( 0.0 );
2729 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2730 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2731 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2732 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2734 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2735 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2737 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2738 connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::populateIcons );
2748 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2757 mTextureWidthSpinBox->blockSignals(
true );
2758 mTextureWidthSpinBox->setValue( width );
2759 mTextureWidthSpinBox->blockSignals(
false );
2761 mRotationSpinBox->blockSignals(
true );
2763 mRotationSpinBox->blockSignals(
false );
2764 mTextureWidthUnitWidget->blockSignals(
true );
2767 mTextureWidthUnitWidget->blockSignals(
false );
2768 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2771 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2772 mChangeColorButton->blockSignals(
true );
2774 mChangeColorButton->blockSignals(
false );
2775 mChangeStrokeColorButton->blockSignals(
true );
2777 mChangeStrokeColorButton->blockSignals(
false );
2778 mStrokeWidthSpinBox->blockSignals(
true );
2780 mStrokeWidthSpinBox->blockSignals(
false );
2803 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2812 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2824 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex &item )
2826 QString file = item.data( Qt::UserRole ).toString();
2836 QAbstractItemModel *oldModel = mSvgTreeView->model();
2838 mSvgTreeView->setModel( g );
2842 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2843 for (
int i = 0; i < rows; i++ )
2845 mSvgTreeView->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2848 oldModel = mSvgListView->model();
2850 mSvgListView->setModel( m );
2854 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2856 QString path = idx.data( Qt::UserRole + 1 ).toString();
2858 QAbstractItemModel *oldModel = mSvgListView->model();
2860 mSvgListView->setModel( m );
2863 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2867 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2879 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2880 QColor defaultFill, defaultStroke;
2881 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2882 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2884 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2885 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2886 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2887 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2890 QColor fill = mChangeColorButton->color();
2891 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2892 if ( hasDefaultFillColor )
2896 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2897 mChangeColorButton->setColor( fill );
2899 mChangeColorButton->setEnabled( hasFillParam );
2900 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2903 QColor stroke = mChangeStrokeColorButton->color();
2904 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2905 if ( hasDefaultStrokeColor )
2907 stroke = defaultStroke;
2909 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2910 mChangeStrokeColorButton->setColor( stroke );
2912 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2913 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2914 if ( hasDefaultStrokeWidth && resetValues )
2916 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2918 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2921 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2932 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2943 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2952 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2962 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
2978 connect( mAngleSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
2979 connect( mDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
2980 connect( mOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
2987 mOffsetSpinBox->setClearValue( 0 );
2988 mAngleSpinBox->setClearValue( 0 );
2993 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
3002 mAngleSpinBox->blockSignals(
true );
3004 mAngleSpinBox->blockSignals(
false );
3005 mDistanceSpinBox->blockSignals(
true );
3007 mDistanceSpinBox->blockSignals(
false );
3008 mOffsetSpinBox->blockSignals(
true );
3010 mOffsetSpinBox->blockSignals(
false );
3013 mDistanceUnitWidget->blockSignals(
true );
3016 mDistanceUnitWidget->blockSignals(
false );
3017 mOffsetUnitWidget->blockSignals(
true );
3020 mOffsetUnitWidget->blockSignals(
false );
3032 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3041 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3050 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3059 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3069 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3085 connect( mHorizontalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3086 connect( mVerticalDistanceSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3087 connect( mHorizontalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3088 connect( mVerticalDisplacementSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3089 connect( mHorizontalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3090 connect( mVerticalOffsetSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3091 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3092 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3093 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3094 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3095 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3096 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3114 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3127 mHorizontalDistanceUnitWidget->blockSignals(
true );
3130 mHorizontalDistanceUnitWidget->blockSignals(
false );
3131 mVerticalDistanceUnitWidget->blockSignals(
true );
3134 mVerticalDistanceUnitWidget->blockSignals(
false );
3135 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3138 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3139 mVerticalDisplacementUnitWidget->blockSignals(
true );
3142 mVerticalDisplacementUnitWidget->blockSignals(
false );
3143 mHorizontalOffsetUnitWidget->blockSignals(
true );
3146 mHorizontalOffsetUnitWidget->blockSignals(
false );
3147 mVerticalOffsetUnitWidget->blockSignals(
true );
3150 mVerticalOffsetUnitWidget->blockSignals(
false );
3165 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3174 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3183 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3192 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3201 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3210 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3219 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3229 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3239 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3249 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3259 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3269 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3290 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3291 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3292 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3302 scrollArea->setVerticalOnly(
true );
3304 btnColor->setAllowOpacity(
true );
3305 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3306 btnColor->setContext( QStringLiteral(
"symbology" ) );
3307 btnStrokeColor->setAllowOpacity(
true );
3308 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3309 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3311 mColorDDBtn->registerLinkedWidget( btnColor );
3312 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3314 spinOffsetX->setClearValue( 0.0 );
3315 spinOffsetY->setClearValue( 0.0 );
3316 spinAngle->setClearValue( 0.0 );
3322 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3325 connect( mFontStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged );
3327 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3330 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3332 connect( spinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3333 connect( spinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3342 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3351 mFontStyleComboBox->blockSignals(
true );
3352 populateFontStyleComboBox();
3353 mFontStyleComboBox->blockSignals(
false );
3371 mCharPreview->setFont( mRefFont );
3377 mSizeUnitWidget->blockSignals(
true );
3380 mSizeUnitWidget->blockSignals(
false );
3382 mStrokeWidthUnitWidget->blockSignals(
true );
3385 mStrokeWidthUnitWidget->blockSignals(
false );
3387 mOffsetUnitWidget->blockSignals(
true );
3390 mOffsetUnitWidget->blockSignals(
false );
3411 updateAssistantSymbol();
3424 mRefFont.setFamily( font.family() );
3426 mCharPreview->setFont( mRefFont );
3427 populateFontStyleComboBox();
3432 void QgsFontMarkerSymbolLayerWidget::setFontStyle(
const QString &style )
3439 mCharPreview->setFont( mRefFont );
3471 mCharPreview->setText( text );
3473 if ( text.isEmpty() )
3477 QString character = text;
3478 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3481 unsigned int value = text.toUInt( &ok, 0 );
3484 character = QChar( value );
3485 mCharPreview->setText( character );
3506 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3508 mCharLineEdit->insert( chr );
3514 mCharPreview->setText( chr );
3518 void QgsFontMarkerSymbolLayerWidget::setOffset()
3520 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3524 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3530 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3540 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3550 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3560 void QgsFontMarkerSymbolLayerWidget::populateFontStyleComboBox()
3562 mFontStyleComboBox->clear();
3563 QStringList styles = mFontDB.styles( mRefFont.family() );
3564 const auto constStyles = styles;
3565 for (
const QString &style : constStyles )
3567 mFontStyleComboBox->addItem( style );
3570 QString targetStyle = mFontDB.styleString( mRefFont );
3571 if ( !styles.contains( targetStyle ) )
3573 QFont f = QFont( mRefFont.family() );
3574 targetStyle = QFontInfo( f ).styleName();
3575 mRefFont.setStyleName( targetStyle );
3578 int stylIndx = mFontStyleComboBox->findText( targetStyle );
3579 if ( stylIndx > -1 )
3584 mFontStyleComboBox->setCurrentIndex( curIndx );
3587 void QgsFontMarkerSymbolLayerWidget::mFontStyleComboBox_currentIndexChanged(
int index )
3590 setFontStyle( mFontStyleComboBox->currentText() );
3593 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3602 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3611 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3620 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3622 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3624 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3626 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3629 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3641 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3642 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3643 connect( mClipPointsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged );
3644 connect( mClipOnCurrentPartOnlyCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged );
3649 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3667 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3673 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3679 void QgsCentroidFillSymbolLayerWidget::mClipPointsCheckBox_stateChanged(
int state )
3685 void QgsCentroidFillSymbolLayerWidget::mClipOnCurrentPartOnlyCheckBox_stateChanged(
int state )
3700 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3704 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3706 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3707 connect( mHeightSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3715 mSpinOffsetX->setClearValue( 0.0 );
3716 mSpinOffsetY->setClearValue( 0.0 );
3717 mRotationSpinBox->setClearValue( 0.0 );
3719 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3720 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3723 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3724 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3734 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3745 mHeightSpinBox->blockSignals(
true );
3746 if ( preservedAspectRatio )
3755 mHeightSpinBox->blockSignals(
false );
3756 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3764 mSizeUnitWidget->blockSignals(
true );
3767 mSizeUnitWidget->blockSignals(
false );
3768 mOffsetUnitWidget->blockSignals(
true );
3771 mOffsetUnitWidget->blockSignals(
false );
3786 updatePreviewImage();
3800 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3803 updatePreviewImage();
3807 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3809 bool fitsInCache =
false;
3811 if ( image.isNull() )
3813 mLabelImagePreview->setPixmap( QPixmap() );
3817 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3818 previewImage.fill( Qt::transparent );
3819 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3821 p.begin( &previewImage );
3823 uchar pixDataRGB[] = { 150, 150, 150, 150,
3828 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3829 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3830 QBrush checkerBrush;
3831 checkerBrush.setTexture( pix );
3832 p.fillRect( imageRect, checkerBrush );
3839 p.drawImage( imageRect.left(), imageRect.top(), image );
3841 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3844 void QgsRasterMarkerSymbolLayerWidget::setWidth()
3847 double fixedAspectRatio = 0.0;
3848 mHeightSpinBox->blockSignals(
true );
3849 if ( defaultAspectRatio <= 0.0 )
3851 mHeightSpinBox->setValue( mWidthSpinBox->value() );
3853 else if ( mLockAspectRatio->locked() )
3855 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
3859 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3861 mHeightSpinBox->blockSignals(
false );
3867 void QgsRasterMarkerSymbolLayerWidget::setHeight()
3870 double fixedAspectRatio = 0.0;
3871 mWidthSpinBox->blockSignals(
true );
3872 if ( defaultAspectRatio <= 0.0 )
3874 mWidthSpinBox->setValue( mHeightSpinBox->value() );
3876 else if ( mLockAspectRatio->locked() )
3878 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
3882 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3884 mWidthSpinBox->blockSignals(
false );
3890 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
3893 if ( defaultAspectRatio <= 0.0 )
3908 void QgsRasterMarkerSymbolLayerWidget::setAngle()
3914 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
3918 updatePreviewImage();
3921 void QgsRasterMarkerSymbolLayerWidget::setOffset()
3923 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3927 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3937 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3947 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3956 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3973 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3977 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
3979 connect( mWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
3986 mSpinOffsetX->setClearValue( 0.0 );
3987 mSpinOffsetY->setClearValue( 0.0 );
3988 mRotationSpinBox->setClearValue( 0.0 );
3990 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
3991 connect( mSpinOffsetX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3992 connect( mSpinOffsetY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
4004 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
4017 cboCoordinateMode->blockSignals(
true );
4021 cboCoordinateMode->setCurrentIndex( 1 );
4025 cboCoordinateMode->setCurrentIndex( 0 );
4028 cboCoordinateMode->blockSignals(
false );
4034 mOffsetUnitWidget->blockSignals(
true );
4037 mOffsetUnitWidget->blockSignals(
false );
4040 mWidthUnitWidget->blockSignals(
true );
4043 mWidthUnitWidget->blockSignals(
false );
4045 updatePreviewImage();
4058 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
4061 updatePreviewImage();
4065 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4082 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4091 updatePreviewImage();
4094 void QgsRasterFillSymbolLayerWidget::offsetChanged()
4096 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4100 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4111 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4120 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4131 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4141 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4143 bool fitsInCache =
false;
4145 if ( image.isNull() )
4147 mLabelImagePreview->setPixmap( QPixmap() );
4151 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4152 previewImage.fill( Qt::transparent );
4153 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4155 p.begin( &previewImage );
4157 uchar pixDataRGB[] = { 150, 150, 150, 150,
4162 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4163 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4164 QBrush checkerBrush;
4165 checkerBrush.setTexture( pix );
4166 p.fillRect( imageRect, checkerBrush );
4173 p.drawImage( imageRect.left(), imageRect.top(), image );
4175 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4184 modificationExpressionSelector->setMultiLine(
true );
4185 modificationExpressionSelector->setLayer(
const_cast<QgsVectorLayer *
>( vl ) );
4186 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4191 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4198 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
4206 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4213 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4233 mPointCountSpinBox->setShowClearButton(
true );
4234 mPointCountSpinBox->setClearValue( 100 );
4235 mSeedSpinBox->setShowClearButton(
true );
4236 mSeedSpinBox->setClearValue( 0 );
4238 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
4239 connect( mPointCountSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
4240 connect( mDensityAreaSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
4241 connect( mSeedSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
4242 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
4259 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
4269 bool showDensityBasedCountWidgets =
false;
4273 showDensityBasedCountWidgets =
true;
4278 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4279 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4280 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4281 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4285 mDensityAreaUnitWidget->blockSignals(
true );
4288 mDensityAreaUnitWidget->blockSignals(
false );
4301 void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
4304 bool showDensityBasedCountWidgets =
false;
4308 showDensityBasedCountWidgets =
true;
4313 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4314 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4315 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4316 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4325 void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
4334 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
4343 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
4353 void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )