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 );
476 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) 479 int width =
static_cast< int >(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 23 );
481 int height =
static_cast< int >( width / 1.61803398875 );
485 QBuffer buffer( &data );
486 pm.save( &buffer,
"PNG", 100 );
487 mChangePatternButton->setToolTip( QStringLiteral(
"<img src='data:image/png;base64, %3'>" ).arg( QString( data.toBase64() ) ) );
492 QgsSymbolLayerWidget::resizeEvent( event );
510 connect( mStrokeStyleComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged );
511 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
512 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
513 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
521 btnChangeColorFill->setAllowOpacity(
true );
522 btnChangeColorFill->setColorDialogTitle( tr(
"Select Fill Color" ) );
523 btnChangeColorFill->setContext( QStringLiteral(
"symbology" ) );
524 btnChangeColorFill->setShowNoColor(
true );
525 btnChangeColorFill->setNoColorString( tr(
"Transparent Fill" ) );
526 btnChangeColorStroke->setAllowOpacity(
true );
527 btnChangeColorStroke->setColorDialogTitle( tr(
"Select Stroke Color" ) );
528 btnChangeColorStroke->setContext( QStringLiteral(
"symbology" ) );
529 btnChangeColorStroke->setShowNoColor(
true );
530 btnChangeColorStroke->setNoColorString( tr(
"Transparent Stroke" ) );
532 mFillColorDDBtn->registerLinkedWidget( btnChangeColorFill );
533 mStrokeColorDDBtn->registerLinkedWidget( btnChangeColorStroke );
535 spinOffsetX->setClearValue( 0.0 );
536 spinOffsetY->setClearValue( 0.0 );
537 spinAngle->setClearValue( 0.0 );
543 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
545 int size = lstNames->iconSize().width();
547 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) 548 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
550 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
553 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
554 lstNames->setIconSize( QSize( size, size ) );
556 double markerSize = size * 0.8;
562 lyr->
setColor( QColor( 200, 200, 200 ) );
565 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
566 item->setData( Qt::UserRole, static_cast< int >( shape ) );
571 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
573 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsSimpleMarkerSymbolLayerWidget::setShape );
576 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged );
577 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setSize );
578 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setAngle );
579 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
580 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleMarkerSymbolLayerWidget::setOffset );
586 if ( layer->
layerType() != QLatin1String(
"SimpleMarker" ) )
594 for (
int i = 0; i < lstNames->count(); ++i )
596 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
598 lstNames->setCurrentRow( i );
602 btnChangeColorStroke->blockSignals(
true );
604 btnChangeColorStroke->blockSignals(
false );
605 btnChangeColorFill->blockSignals(
true );
608 btnChangeColorFill->blockSignals(
false );
609 spinSize->blockSignals(
true );
611 spinSize->blockSignals(
false );
612 spinAngle->blockSignals(
true );
614 spinAngle->blockSignals(
false );
615 mStrokeStyleComboBox->blockSignals(
true );
617 mStrokeStyleComboBox->blockSignals(
false );
618 mStrokeWidthSpinBox->blockSignals(
true );
620 mStrokeWidthSpinBox->blockSignals(
false );
621 cboJoinStyle->blockSignals(
true );
623 cboJoinStyle->blockSignals(
false );
626 spinOffsetX->blockSignals(
true );
628 spinOffsetX->blockSignals(
false );
629 spinOffsetY->blockSignals(
true );
631 spinOffsetY->blockSignals(
false );
633 mSizeUnitWidget->blockSignals(
true );
636 mSizeUnitWidget->blockSignals(
false );
637 mOffsetUnitWidget->blockSignals(
true );
640 mOffsetUnitWidget->blockSignals(
false );
641 mStrokeWidthUnitWidget->blockSignals(
true );
644 mStrokeWidthUnitWidget->blockSignals(
false );
647 mHorizontalAnchorComboBox->blockSignals(
true );
648 mVerticalAnchorComboBox->blockSignals(
true );
651 mHorizontalAnchorComboBox->blockSignals(
false );
652 mVerticalAnchorComboBox->blockSignals(
false );
666 updateAssistantSymbol();
674 void QgsSimpleMarkerSymbolLayerWidget::setShape()
676 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
693 void QgsSimpleMarkerSymbolLayerWidget::penJoinStyleChanged()
699 void QgsSimpleMarkerSymbolLayerWidget::setSize()
705 void QgsSimpleMarkerSymbolLayerWidget::setAngle()
711 void QgsSimpleMarkerSymbolLayerWidget::setOffset()
713 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
717 void QgsSimpleMarkerSymbolLayerWidget::mStrokeStyleComboBox_currentIndexChanged(
int index )
728 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
737 void QgsSimpleMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
747 void QgsSimpleMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
757 void QgsSimpleMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
767 void QgsSimpleMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
776 void QgsSimpleMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
785 void QgsSimpleMarkerSymbolLayerWidget::updateAssistantSymbol()
787 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
789 mAssistantPreviewSymbol->deleteSymbolLayer( i );
791 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
794 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
813 btnChangeColor->setAllowOpacity(
true );
814 btnChangeColor->setColorDialogTitle( tr(
"Select Fill Color" ) );
815 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
816 btnChangeColor->setShowNoColor(
true );
817 btnChangeColor->setNoColorString( tr(
"Transparent Fill" ) );
818 btnChangeStrokeColor->setAllowOpacity(
true );
819 btnChangeStrokeColor->setColorDialogTitle( tr(
"Select Stroke Color" ) );
820 btnChangeStrokeColor->setContext( QStringLiteral(
"symbology" ) );
821 btnChangeStrokeColor->setShowNoColor(
true );
822 btnChangeStrokeColor->setNoColorString( tr(
"Transparent Stroke" ) );
824 spinOffsetX->setClearValue( 0.0 );
825 spinOffsetY->setClearValue( 0.0 );
828 connect( cboFillStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::setBrushStyle );
830 connect( spinStrokeWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeWidthChanged );
831 connect( cboStrokeStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
832 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSimpleFillSymbolLayerWidget::strokeStyleChanged );
833 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
834 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSimpleFillSymbolLayerWidget::offsetChanged );
836 mFillColorDDBtn->registerLinkedWidget( btnChangeColor );
837 mStrokeColorDDBtn->registerLinkedWidget( btnChangeStrokeColor );
842 if ( layer->
layerType() != QLatin1String(
"SimpleFill" ) )
849 btnChangeColor->blockSignals(
true );
851 btnChangeColor->blockSignals(
false );
852 cboFillStyle->blockSignals(
true );
854 cboFillStyle->blockSignals(
false );
855 btnChangeStrokeColor->blockSignals(
true );
857 btnChangeStrokeColor->blockSignals(
false );
858 cboStrokeStyle->blockSignals(
true );
860 cboStrokeStyle->blockSignals(
false );
861 spinStrokeWidth->blockSignals(
true );
863 spinStrokeWidth->blockSignals(
false );
864 cboJoinStyle->blockSignals(
true );
866 cboJoinStyle->blockSignals(
false );
867 spinOffsetX->blockSignals(
true );
869 spinOffsetX->blockSignals(
false );
870 spinOffsetY->blockSignals(
true );
872 spinOffsetY->blockSignals(
false );
874 mStrokeWidthUnitWidget->blockSignals(
true );
877 mStrokeWidthUnitWidget->blockSignals(
false );
878 mOffsetUnitWidget->blockSignals(
true );
881 mOffsetUnitWidget->blockSignals(
false );
909 void QgsSimpleFillSymbolLayerWidget::setBrushStyle()
915 void QgsSimpleFillSymbolLayerWidget::strokeWidthChanged()
921 void QgsSimpleFillSymbolLayerWidget::strokeStyleChanged()
928 void QgsSimpleFillSymbolLayerWidget::offsetChanged()
930 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
934 void QgsSimpleFillSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
944 void QgsSimpleFillSymbolLayerWidget::mOffsetUnitWidget_changed()
964 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
965 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
971 spinOffsetX->setClearValue( 0.0 );
972 spinOffsetY->setClearValue( 0.0 );
973 spinAngle->setClearValue( 0.0 );
979 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
981 int size = lstNames->iconSize().width();
982 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) 983 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 3 ) ) );
985 size = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 3 ) ) );
987 lstNames->setGridSize( QSize( size * 1.2, size * 1.2 ) );
988 lstNames->setIconSize( QSize( size, size ) );
990 double markerSize = size * 0.8;
996 lyr->
setColor( QColor( 200, 200, 200 ) );
999 QListWidgetItem *item =
new QListWidgetItem( icon, QString(), lstNames );
1000 item->setData( Qt::UserRole, static_cast< int >( shape ) );
1005 lstNames->setMinimumHeight( lstNames->gridSize().height() * 3.1 );
1007 connect( lstNames, &QListWidget::currentRowChanged,
this, &QgsFilledMarkerSymbolLayerWidget::setShape );
1008 connect( spinSize, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setSize );
1009 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setAngle );
1010 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1011 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFilledMarkerSymbolLayerWidget::setOffset );
1017 if ( layer->
layerType() != QLatin1String(
"FilledMarker" ) )
1025 for (
int i = 0; i < lstNames->count(); ++i )
1027 if ( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape >( lstNames->item( i )->data( Qt::UserRole ).toInt() ) == shape )
1029 lstNames->setCurrentRow( i );
1038 mSizeUnitWidget->blockSignals(
true );
1041 mSizeUnitWidget->blockSignals(
false );
1042 mOffsetUnitWidget->blockSignals(
true );
1045 mOffsetUnitWidget->blockSignals(
false );
1058 updateAssistantSymbol();
1066 void QgsFilledMarkerSymbolLayerWidget::setShape()
1068 mLayer->
setShape( static_cast< QgsSimpleMarkerSymbolLayerBase::Shape>( lstNames->currentItem()->data( Qt::UserRole ).toInt() ) );
1072 void QgsFilledMarkerSymbolLayerWidget::setSize()
1078 void QgsFilledMarkerSymbolLayerWidget::setAngle()
1084 void QgsFilledMarkerSymbolLayerWidget::setOffset()
1086 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1090 void QgsFilledMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
1100 void QgsFilledMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
1110 void QgsFilledMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
1119 void QgsFilledMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
1128 void QgsFilledMarkerSymbolLayerWidget::updateAssistantSymbol()
1130 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
1132 mAssistantPreviewSymbol->deleteSymbolLayer( i );
1134 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
1137 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
1150 connect( mSpinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged );
1154 btnColorRamp->setShowGradientOnly(
true );
1156 btnChangeColor->setAllowOpacity(
true );
1157 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1158 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1159 btnChangeColor->setShowNoColor(
true );
1160 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1161 btnChangeColor2->setAllowOpacity(
true );
1162 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1163 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1164 btnChangeColor2->setShowNoColor(
true );
1165 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1167 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1168 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1170 spinOffsetX->setClearValue( 0.0 );
1171 spinOffsetY->setClearValue( 0.0 );
1172 mSpinAngle->setClearValue( 0.0 );
1180 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::colorModeChanged );
1181 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1182 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::offsetChanged );
1183 connect( spinRefPoint1X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1184 connect( spinRefPoint1Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1185 connect( checkRefPoint1Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1186 connect( spinRefPoint2X, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1187 connect( spinRefPoint2Y, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1188 connect( checkRefPoint2Centroid, &QAbstractButton::toggled,
this, &QgsGradientFillSymbolLayerWidget::referencePointChanged );
1193 if ( layer->
layerType() != QLatin1String(
"GradientFill" ) )
1200 btnChangeColor->blockSignals(
true );
1202 btnChangeColor->blockSignals(
false );
1203 btnChangeColor2->blockSignals(
true );
1205 btnChangeColor2->blockSignals(
false );
1209 radioTwoColor->setChecked(
true );
1210 btnColorRamp->setEnabled(
false );
1214 radioColorRamp->setChecked(
true );
1215 btnChangeColor->setEnabled(
false );
1216 btnChangeColor2->setEnabled(
false );
1222 btnColorRamp->blockSignals(
true );
1224 btnColorRamp->blockSignals(
false );
1227 cboGradientType->blockSignals(
true );
1231 cboGradientType->setCurrentIndex( 0 );
1234 cboGradientType->setCurrentIndex( 1 );
1237 cboGradientType->setCurrentIndex( 2 );
1240 cboGradientType->blockSignals(
false );
1242 cboCoordinateMode->blockSignals(
true );
1246 cboCoordinateMode->setCurrentIndex( 1 );
1247 checkRefPoint1Centroid->setEnabled(
false );
1248 checkRefPoint2Centroid->setEnabled(
false );
1252 cboCoordinateMode->setCurrentIndex( 0 );
1255 cboCoordinateMode->blockSignals(
false );
1257 cboGradientSpread->blockSignals(
true );
1261 cboGradientSpread->setCurrentIndex( 0 );
1264 cboGradientSpread->setCurrentIndex( 1 );
1267 cboGradientSpread->setCurrentIndex( 2 );
1270 cboGradientSpread->blockSignals(
false );
1272 spinRefPoint1X->blockSignals(
true );
1274 spinRefPoint1X->blockSignals(
false );
1275 spinRefPoint1Y->blockSignals(
true );
1277 spinRefPoint1Y->blockSignals(
false );
1278 checkRefPoint1Centroid->blockSignals(
true );
1282 spinRefPoint1X->setEnabled(
false );
1283 spinRefPoint1Y->setEnabled(
false );
1285 checkRefPoint1Centroid->blockSignals(
false );
1286 spinRefPoint2X->blockSignals(
true );
1288 spinRefPoint2X->blockSignals(
false );
1289 spinRefPoint2Y->blockSignals(
true );
1291 spinRefPoint2Y->blockSignals(
false );
1292 checkRefPoint2Centroid->blockSignals(
true );
1296 spinRefPoint2X->setEnabled(
false );
1297 spinRefPoint2Y->setEnabled(
false );
1299 checkRefPoint2Centroid->blockSignals(
false );
1301 spinOffsetX->blockSignals(
true );
1303 spinOffsetX->blockSignals(
false );
1304 spinOffsetY->blockSignals(
true );
1306 spinOffsetY->blockSignals(
false );
1307 mSpinAngle->blockSignals(
true );
1309 mSpinAngle->blockSignals(
false );
1311 mOffsetUnitWidget->blockSignals(
true );
1314 mOffsetUnitWidget->blockSignals(
false );
1347 void QgsGradientFillSymbolLayerWidget::colorModeChanged()
1349 if ( radioTwoColor->isChecked() )
1362 if ( btnColorRamp->isNull() )
1376 spinRefPoint1X->setValue( 0.5 );
1377 spinRefPoint1Y->setValue( 0 );
1378 spinRefPoint2X->setValue( 0.5 );
1379 spinRefPoint2Y->setValue( 1 );
1384 spinRefPoint1X->setValue( 0 );
1385 spinRefPoint1Y->setValue( 0 );
1386 spinRefPoint2X->setValue( 1 );
1387 spinRefPoint2Y->setValue( 1 );
1391 spinRefPoint1X->setValue( 0.5 );
1392 spinRefPoint1Y->setValue( 0.5 );
1393 spinRefPoint2X->setValue( 1 );
1394 spinRefPoint2Y->setValue( 1 );
1409 checkRefPoint1Centroid->setEnabled(
true );
1410 checkRefPoint2Centroid->setEnabled(
true );
1416 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1417 checkRefPoint1Centroid->setEnabled(
false );
1418 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1419 checkRefPoint2Centroid->setEnabled(
false );
1444 void QgsGradientFillSymbolLayerWidget::offsetChanged()
1446 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1450 void QgsGradientFillSymbolLayerWidget::referencePointChanged()
1459 void QgsGradientFillSymbolLayerWidget::mSpinAngle_valueChanged(
double value )
1465 void QgsGradientFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1483 connect( mSpinBlurRadius, qgis::overload< int >::of( &QSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged );
1484 connect( mSpinMaxDistance, qgis::overload< double >::of( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged );
1486 connect( mRadioUseWholeShape, &QRadioButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled );
1488 connect( mIgnoreRingsCheckBox, &QCheckBox::stateChanged,
this, &QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged );
1494 QButtonGroup *group1 =
new QButtonGroup(
this );
1495 group1->addButton( radioColorRamp );
1496 group1->addButton( radioTwoColor );
1497 QButtonGroup *group2 =
new QButtonGroup(
this );
1498 group2->addButton( mRadioUseMaxDistance );
1499 group2->addButton( mRadioUseWholeShape );
1500 btnChangeColor->setAllowOpacity(
true );
1501 btnChangeColor->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1502 btnChangeColor->setContext( QStringLiteral(
"symbology" ) );
1503 btnChangeColor->setShowNoColor(
true );
1504 btnChangeColor->setNoColorString( tr(
"Transparent" ) );
1505 btnChangeColor2->setAllowOpacity(
true );
1506 btnChangeColor2->setColorDialogTitle( tr(
"Select Gradient Color" ) );
1507 btnChangeColor2->setContext( QStringLiteral(
"symbology" ) );
1508 btnChangeColor2->setShowNoColor(
true );
1509 btnChangeColor2->setNoColorString( tr(
"Transparent" ) );
1511 mStartColorDDBtn->registerLinkedWidget( btnChangeColor );
1512 mEndColorDDBtn->registerLinkedWidget( btnChangeColor2 );
1514 spinOffsetX->setClearValue( 0.0 );
1515 spinOffsetY->setClearValue( 0.0 );
1517 btnColorRamp->setShowGradientOnly(
true );
1523 connect( radioTwoColor, &QAbstractButton::toggled,
this, &QgsShapeburstFillSymbolLayerWidget::colorModeChanged );
1524 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1525 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsShapeburstFillSymbolLayerWidget::offsetChanged );
1527 connect( mBlurSlider, &QAbstractSlider::valueChanged, mSpinBlurRadius, &QSpinBox::setValue );
1528 connect( mSpinBlurRadius, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ), mBlurSlider, &QAbstractSlider::setValue );
1533 if ( layer->
layerType() != QLatin1String(
"ShapeburstFill" ) )
1540 btnChangeColor->blockSignals(
true );
1542 btnChangeColor->blockSignals(
false );
1543 btnChangeColor2->blockSignals(
true );
1545 btnChangeColor2->blockSignals(
false );
1549 radioTwoColor->setChecked(
true );
1550 btnColorRamp->setEnabled(
false );
1554 radioColorRamp->setChecked(
true );
1555 btnChangeColor->setEnabled(
false );
1556 btnChangeColor2->setEnabled(
false );
1559 mSpinBlurRadius->blockSignals(
true );
1560 mBlurSlider->blockSignals(
true );
1563 mSpinBlurRadius->blockSignals(
false );
1564 mBlurSlider->blockSignals(
false );
1566 mSpinMaxDistance->blockSignals(
true );
1568 mSpinMaxDistance->blockSignals(
false );
1570 mRadioUseWholeShape->blockSignals(
true );
1571 mRadioUseMaxDistance->blockSignals(
true );
1574 mRadioUseWholeShape->setChecked(
true );
1575 mSpinMaxDistance->setEnabled(
false );
1576 mDistanceUnitWidget->setEnabled(
false );
1580 mRadioUseMaxDistance->setChecked(
true );
1581 mSpinMaxDistance->setEnabled(
true );
1582 mDistanceUnitWidget->setEnabled(
true );
1584 mRadioUseWholeShape->blockSignals(
false );
1585 mRadioUseMaxDistance->blockSignals(
false );
1587 mDistanceUnitWidget->blockSignals(
true );
1590 mDistanceUnitWidget->blockSignals(
false );
1592 mIgnoreRingsCheckBox->blockSignals(
true );
1593 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1594 mIgnoreRingsCheckBox->blockSignals(
false );
1599 btnColorRamp->blockSignals(
true );
1601 btnColorRamp->blockSignals(
false );
1604 spinOffsetX->blockSignals(
true );
1606 spinOffsetX->blockSignals(
false );
1607 spinOffsetY->blockSignals(
true );
1609 spinOffsetY->blockSignals(
false );
1610 mOffsetUnitWidget->blockSignals(
true );
1613 mOffsetUnitWidget->blockSignals(
false );
1646 void QgsShapeburstFillSymbolLayerWidget::colorModeChanged()
1653 if ( radioTwoColor->isChecked() )
1664 void QgsShapeburstFillSymbolLayerWidget::mSpinBlurRadius_valueChanged(
int value )
1673 void QgsShapeburstFillSymbolLayerWidget::mSpinMaxDistance_valueChanged(
double value )
1682 void QgsShapeburstFillSymbolLayerWidget::mDistanceUnitWidget_changed()
1692 void QgsShapeburstFillSymbolLayerWidget::mRadioUseWholeShape_toggled(
bool value )
1697 mDistanceUnitWidget->setEnabled( !value );
1702 void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
1712 void QgsShapeburstFillSymbolLayerWidget::offsetChanged()
1716 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
1721 void QgsShapeburstFillSymbolLayerWidget::mOffsetUnitWidget_changed()
1732 void QgsShapeburstFillSymbolLayerWidget::mIgnoreRingsCheckBox_stateChanged(
int state )
1734 bool checked = ( state == Qt::Checked );
1763 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
1767 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
1772 spinOffset->setClearValue( 0.0 );
1777 mRingFilterComboBox->hide();
1778 mRingsLabel->hide();
1781 mSpinAverageAngleLength->setClearValue( 4.0 );
1785 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setRotate );
1786 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setOffset );
1787 connect( mSpinAverageAngleLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsMarkerLineSymbolLayerWidget::setAverageAngle );
1788 connect( radInterval, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1789 connect( radVertex, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1790 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1791 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1792 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1793 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1794 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsMarkerLineSymbolLayerWidget::setPlacement );
1799 if ( layer->
layerType() != QLatin1String(
"MarkerLine" ) )
1806 spinInterval->blockSignals(
true );
1808 spinInterval->blockSignals(
false );
1809 mSpinOffsetAlongLine->blockSignals(
true );
1811 mSpinOffsetAlongLine->blockSignals(
false );
1812 chkRotateMarker->blockSignals(
true );
1814 chkRotateMarker->blockSignals(
false );
1815 spinOffset->blockSignals(
true );
1817 spinOffset->blockSignals(
false );
1819 radInterval->setChecked(
true );
1821 radVertex->setChecked(
true );
1823 radVertexLast->setChecked(
true );
1825 radCentralPoint->setChecked(
true );
1827 radCurvePoint->setChecked(
true );
1829 radSegmentCentralPoint->setChecked(
true );
1831 radVertexFirst->setChecked(
true );
1834 mIntervalUnitWidget->blockSignals(
true );
1837 mIntervalUnitWidget->blockSignals(
false );
1838 mOffsetUnitWidget->blockSignals(
true );
1841 mOffsetUnitWidget->blockSignals(
false );
1842 mOffsetAlongLineUnitWidget->blockSignals(
true );
1845 mOffsetAlongLineUnitWidget->blockSignals(
false );
1879 void QgsMarkerLineSymbolLayerWidget::setRotate()
1881 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1882 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1888 void QgsMarkerLineSymbolLayerWidget::setOffset()
1894 void QgsMarkerLineSymbolLayerWidget::setPlacement()
1896 bool interval = radInterval->isChecked();
1897 spinInterval->setEnabled( interval );
1898 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1899 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
1900 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
1901 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
1903 if ( radInterval->isChecked() )
1905 else if ( radVertex->isChecked() )
1907 else if ( radVertexLast->isChecked() )
1909 else if ( radVertexFirst->isChecked() )
1911 else if ( radCurvePoint->isChecked() )
1913 else if ( radSegmentCentralPoint->isChecked() )
1921 void QgsMarkerLineSymbolLayerWidget::mIntervalUnitWidget_changed()
1931 void QgsMarkerLineSymbolLayerWidget::mOffsetUnitWidget_changed()
1941 void QgsMarkerLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
1951 void QgsMarkerLineSymbolLayerWidget::averageAngleUnitChanged()
1961 void QgsMarkerLineSymbolLayerWidget::setAverageAngle(
double val )
1998 connect( mRingFilterComboBox, qgis::overload< int >::of( &QComboBox::currentIndexChanged ),
this, [ = ](
int )
2002 mLayer->
setRingFilter( static_cast< QgsLineSymbolLayer::RenderRingFilter >( mRingFilterComboBox->currentData().toInt() ) );
2007 spinOffset->setClearValue( 0.0 );
2012 mRingFilterComboBox->hide();
2013 mRingsLabel->hide();
2016 mHashRotationSpinBox->setClearValue( 0 );
2017 mSpinAverageAngleLength->setClearValue( 4.0 );
2019 connect( spinInterval, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setInterval );
2020 connect( mSpinOffsetAlongLine, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffsetAlongLine );
2021 connect( mSpinHashLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashLength );
2022 connect( mHashRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setHashAngle );
2023 connect( chkRotateMarker, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setRotate );
2024 connect( spinOffset, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setOffset );
2025 connect( mSpinAverageAngleLength, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsHashedLineSymbolLayerWidget::setAverageAngle );
2026 connect( radInterval, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2027 connect( radVertex, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2028 connect( radVertexLast, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2029 connect( radVertexFirst, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2030 connect( radCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2031 connect( radCurvePoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2032 connect( radSegmentCentralPoint, &QAbstractButton::clicked,
this, &QgsHashedLineSymbolLayerWidget::setPlacement );
2037 if ( layer->
layerType() != QLatin1String(
"HashLine" ) )
2044 spinInterval->blockSignals(
true );
2045 spinInterval->setValue( mLayer->
interval() );
2046 spinInterval->blockSignals(
false );
2047 mSpinOffsetAlongLine->blockSignals(
true );
2049 mSpinOffsetAlongLine->blockSignals(
false );
2052 chkRotateMarker->blockSignals(
true );
2054 chkRotateMarker->blockSignals(
false );
2055 spinOffset->blockSignals(
true );
2056 spinOffset->setValue( mLayer->
offset() );
2057 spinOffset->blockSignals(
false );
2059 radInterval->setChecked(
true );
2061 radVertex->setChecked(
true );
2063 radVertexLast->setChecked(
true );
2065 radCentralPoint->setChecked(
true );
2067 radCurvePoint->setChecked(
true );
2069 radSegmentCentralPoint->setChecked(
true );
2071 radVertexFirst->setChecked(
true );
2074 mIntervalUnitWidget->blockSignals(
true );
2075 mIntervalUnitWidget->setUnit( mLayer->
intervalUnit() );
2077 mIntervalUnitWidget->blockSignals(
false );
2078 mOffsetUnitWidget->blockSignals(
true );
2079 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
2081 mOffsetUnitWidget->blockSignals(
false );
2082 mOffsetAlongLineUnitWidget->blockSignals(
true );
2085 mOffsetAlongLineUnitWidget->blockSignals(
false );
2092 whileBlocking( mRingFilterComboBox )->setCurrentIndex( mRingFilterComboBox->findData( mLayer->
ringFilter() ) );
2110 void QgsHashedLineSymbolLayerWidget::setInterval(
double val )
2116 void QgsHashedLineSymbolLayerWidget::setOffsetAlongLine(
double val )
2122 void QgsHashedLineSymbolLayerWidget::setHashLength(
double val )
2128 void QgsHashedLineSymbolLayerWidget::setHashAngle(
double val )
2134 void QgsHashedLineSymbolLayerWidget::setRotate()
2136 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2137 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2143 void QgsHashedLineSymbolLayerWidget::setOffset()
2145 mLayer->
setOffset( spinOffset->value() );
2149 void QgsHashedLineSymbolLayerWidget::setPlacement()
2151 bool interval = radInterval->isChecked();
2152 spinInterval->setEnabled( interval );
2153 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
2154 mOffsetAlongLineUnitWidget->setEnabled( mSpinOffsetAlongLine->isEnabled() );
2155 mSpinAverageAngleLength->setEnabled( chkRotateMarker->isChecked() && ( radInterval->isChecked() || radCentralPoint->isChecked() ) );
2156 mAverageAngleUnit->setEnabled( mSpinAverageAngleLength->isEnabled() );
2158 if ( radInterval->isChecked() )
2160 else if ( radVertex->isChecked() )
2162 else if ( radVertexLast->isChecked() )
2164 else if ( radVertexFirst->isChecked() )
2166 else if ( radCurvePoint->isChecked() )
2168 else if ( radSegmentCentralPoint->isChecked() )
2176 void QgsHashedLineSymbolLayerWidget::mIntervalUnitWidget_changed()
2186 void QgsHashedLineSymbolLayerWidget::mOffsetUnitWidget_changed()
2196 void QgsHashedLineSymbolLayerWidget::mOffsetAlongLineUnitWidget_changed()
2206 void QgsHashedLineSymbolLayerWidget::hashLengthUnitWidgetChanged()
2216 void QgsHashedLineSymbolLayerWidget::averageAngleUnitChanged()
2226 void QgsHashedLineSymbolLayerWidget::setAverageAngle(
double val )
2245 mSvgSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastSVGMarkerDir" ) );
2249 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2250 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2254 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
2255 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
2262 viewGroups->setHeaderHidden(
true );
2263 mChangeColorButton->setAllowOpacity(
true );
2264 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill color" ) );
2265 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2266 mChangeStrokeColorButton->setAllowOpacity(
true );
2267 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2268 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2270 mFillColorDDBtn->registerLinkedWidget( mChangeColorButton );
2271 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2273 spinOffsetX->setClearValue( 0.0 );
2274 spinOffsetY->setClearValue( 0.0 );
2275 spinAngle->setClearValue( 0.0 );
2277 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) 2278 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 4 ) ) );
2280 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 4 ) ) );
2282 viewImages->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2286 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2287 connect( viewGroups->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::populateIcons );
2288 connect( spinWidth, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setWidth );
2289 connect( spinHeight, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setHeight );
2291 connect( spinAngle, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setAngle );
2292 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2293 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSvgMarkerSymbolLayerWidget::setOffset );
2302 mWidthDDBtn->setSymbol( mAssistantPreviewSymbol );
2303 mHeightDDBtn->setSymbol( mAssistantPreviewSymbol );
2308 #include <QAbstractListModel> 2309 #include <QPixmapCache> 2315 QAbstractItemModel *oldModel = viewGroups->model();
2317 viewGroups->setModel( g );
2321 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2322 for (
int i = 0; i < rows; i++ )
2324 viewGroups->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2328 oldModel = viewImages->model();
2330 viewImages->setModel( m );
2334 void QgsSvgMarkerSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2336 QString path = idx.data( Qt::UserRole + 1 ).toString();
2338 QAbstractItemModel *oldModel = viewImages->model();
2340 viewImages->setModel( m );
2343 connect( viewImages->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSvgMarkerSymbolLayerWidget::setName );
2354 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2355 QColor defaultFill, defaultStroke;
2356 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2357 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2359 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2360 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2361 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2362 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2363 mChangeColorButton->setEnabled( hasFillParam );
2364 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2365 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2366 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2367 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2372 double existingOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2373 if ( hasDefaultFillColor )
2377 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : existingOpacity );
2378 mChangeColorButton->setColor( fill );
2380 if ( hasStrokeParam )
2383 double existingOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2384 if ( hasDefaultStrokeColor )
2386 stroke = defaultStroke;
2388 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : existingOpacity );
2389 mChangeStrokeColorButton->setColor( stroke );
2394 mStrokeWidthSpinBox->blockSignals(
true );
2395 mStrokeWidthSpinBox->setValue( hasDefaultStrokeWidth ? defaultStrokeWidth : layer->
strokeWidth() );
2396 mStrokeWidthSpinBox->blockSignals(
false );
2399 spinHeight->blockSignals(
true );
2400 if ( preservedAspectRatio )
2402 spinHeight->setValue( layer->
size() );
2409 spinHeight->blockSignals(
false );
2410 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
2413 void QgsSvgMarkerSymbolLayerWidget::updateAssistantSymbol()
2415 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
2417 mAssistantPreviewSymbol->deleteSymbolLayer( i );
2419 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
2422 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
2433 if ( layer->
layerType() != QLatin1String(
"SvgMarker" ) )
2441 QAbstractItemModel *m = viewImages->model();
2442 QItemSelectionModel *selModel = viewImages->selectionModel();
2443 for (
int i = 0; i < m->rowCount(); i++ )
2445 QModelIndex idx( m->index( i, 0 ) );
2446 if ( m->data( idx ).toString() ==
mLayer->
path() )
2448 selModel->select( idx, QItemSelectionModel::SelectCurrent );
2449 selModel->setCurrentIndex( idx, QItemSelectionModel::SelectCurrent );
2455 spinWidth->blockSignals(
true );
2457 spinWidth->blockSignals(
false );
2458 spinAngle->blockSignals(
true );
2460 spinAngle->blockSignals(
false );
2463 spinOffsetX->blockSignals(
true );
2465 spinOffsetX->blockSignals(
false );
2466 spinOffsetY->blockSignals(
true );
2468 spinOffsetY->blockSignals(
false );
2470 mSizeUnitWidget->blockSignals(
true );
2473 mSizeUnitWidget->blockSignals(
false );
2474 mStrokeWidthUnitWidget->blockSignals(
true );
2477 mStrokeWidthUnitWidget->blockSignals(
false );
2478 mOffsetUnitWidget->blockSignals(
true );
2481 mOffsetUnitWidget->blockSignals(
false );
2484 mHorizontalAnchorComboBox->blockSignals(
true );
2485 mVerticalAnchorComboBox->blockSignals(
true );
2488 mHorizontalAnchorComboBox->blockSignals(
false );
2489 mVerticalAnchorComboBox->blockSignals(
false );
2504 updateAssistantSymbol();
2515 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2518 void QgsSvgMarkerSymbolLayerWidget::setName(
const QModelIndex &idx )
2520 QString name = idx.data( Qt::UserRole ).toString();
2528 void QgsSvgMarkerSymbolLayerWidget::setWidth()
2531 double fixedAspectRatio = 0.0;
2532 spinHeight->blockSignals(
true );
2533 if ( defaultAspectRatio <= 0.0 )
2535 spinHeight->setValue( spinWidth->value() );
2537 else if ( mLockAspectRatio->locked() )
2539 spinHeight->setValue( spinWidth->value() * defaultAspectRatio );
2543 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2545 spinHeight->blockSignals(
false );
2551 void QgsSvgMarkerSymbolLayerWidget::setHeight()
2554 double fixedAspectRatio = 0.0;
2555 spinWidth->blockSignals(
true );
2556 if ( defaultAspectRatio <= 0.0 )
2558 spinWidth->setValue( spinHeight->value() );
2560 else if ( mLockAspectRatio->locked() )
2562 spinWidth->setValue( spinHeight->value() / defaultAspectRatio );
2566 fixedAspectRatio = spinHeight->value() / spinWidth->value();
2568 spinWidth->blockSignals(
false );
2574 void QgsSvgMarkerSymbolLayerWidget::lockAspectRatioChanged(
const bool locked )
2578 if ( defaultAspectRatio <= 0.0 )
2594 void QgsSvgMarkerSymbolLayerWidget::setAngle()
2600 void QgsSvgMarkerSymbolLayerWidget::setOffset()
2602 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
2606 void QgsSvgMarkerSymbolLayerWidget::svgSourceChanged(
const QString &text )
2613 void QgsSvgMarkerSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2624 void QgsSvgMarkerSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2635 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2644 void QgsSvgMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
2654 void QgsSvgMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
2664 void QgsSvgMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
2674 void QgsSvgMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
2683 void QgsSvgMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
2698 connect( mTextureWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged );
2700 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
2702 connect( mChangeStrokeColorButton, &
QgsColorButton::colorChanged,
this, &QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged );
2703 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
2710 mSvgTreeView->setHeaderHidden(
true );
2712 #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) 2713 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().width(
'X' ) * 4 ) ) );
2715 mIconSize = std::max( 30, static_cast< int >( std::round(
Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance(
'X' ) * 4 ) ) );
2717 mSvgListView->setGridSize( QSize( mIconSize * 1.2, mIconSize * 1.2 ) );
2721 mRotationSpinBox->setClearValue( 0.0 );
2723 mChangeColorButton->setColorDialogTitle( tr(
"Select Fill Color" ) );
2724 mChangeColorButton->setContext( QStringLiteral(
"symbology" ) );
2725 mChangeStrokeColorButton->setColorDialogTitle( tr(
"Select Stroke Color" ) );
2726 mChangeStrokeColorButton->setContext( QStringLiteral(
"symbology" ) );
2728 mFilColorDDBtn->registerLinkedWidget( mChangeColorButton );
2729 mStrokeColorDDBtn->registerLinkedWidget( mChangeStrokeColorButton );
2731 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2732 connect( mSvgTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::populateIcons );
2742 if ( layer->
layerType() != QLatin1String(
"SVGFill" ) )
2751 mTextureWidthSpinBox->blockSignals(
true );
2752 mTextureWidthSpinBox->setValue( width );
2753 mTextureWidthSpinBox->blockSignals(
false );
2755 mRotationSpinBox->blockSignals(
true );
2757 mRotationSpinBox->blockSignals(
false );
2758 mTextureWidthUnitWidget->blockSignals(
true );
2761 mTextureWidthUnitWidget->blockSignals(
false );
2762 mSvgStrokeWidthUnitWidget->blockSignals(
true );
2765 mSvgStrokeWidthUnitWidget->blockSignals(
false );
2766 mChangeColorButton->blockSignals(
true );
2768 mChangeColorButton->blockSignals(
false );
2769 mChangeStrokeColorButton->blockSignals(
true );
2771 mChangeStrokeColorButton->blockSignals(
false );
2772 mStrokeWidthSpinBox->blockSignals(
true );
2774 mStrokeWidthSpinBox->blockSignals(
false );
2794 mSvgSourceLineEdit->setMessageBar( context.
messageBar() );
2797 void QgsSVGFillSymbolLayerWidget::mTextureWidthSpinBox_valueChanged(
double d )
2806 void QgsSVGFillSymbolLayerWidget::svgSourceChanged(
const QString &text )
2818 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex &item )
2820 QString file = item.data( Qt::UserRole ).toString();
2830 QAbstractItemModel *oldModel = mSvgTreeView->model();
2832 mSvgTreeView->setModel( g );
2836 int rows = g->rowCount( g->indexFromItem( g->invisibleRootItem() ) );
2837 for (
int i = 0; i < rows; i++ )
2839 mSvgTreeView->setExpanded( g->indexFromItem( g->item( i ) ),
true );
2842 oldModel = mSvgListView->model();
2844 mSvgListView->setModel( m );
2848 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex &idx )
2850 QString path = idx.data( Qt::UserRole + 1 ).toString();
2852 QAbstractItemModel *oldModel = mSvgListView->model();
2854 mSvgListView->setModel( m );
2857 connect( mSvgListView->selectionModel(), &QItemSelectionModel::currentChanged,
this, &QgsSVGFillSymbolLayerWidget::setFile );
2861 void QgsSVGFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
2873 bool hasFillParam, hasFillOpacityParam, hasStrokeParam, hasStrokeWidthParam, hasStrokeOpacityParam;
2874 QColor defaultFill, defaultStroke;
2875 double defaultStrokeWidth, defaultFillOpacity, defaultStrokeOpacity;
2876 bool hasDefaultFillColor, hasDefaultFillOpacity, hasDefaultStrokeColor, hasDefaultStrokeWidth, hasDefaultStrokeOpacity;
2878 hasFillOpacityParam, hasDefaultFillOpacity, defaultFillOpacity,
2879 hasStrokeParam, hasDefaultStrokeColor, defaultStroke,
2880 hasStrokeWidthParam, hasDefaultStrokeWidth, defaultStrokeWidth,
2881 hasStrokeOpacityParam, hasDefaultStrokeOpacity, defaultStrokeOpacity );
2884 QColor fill = mChangeColorButton->color();
2885 double newOpacity = hasFillOpacityParam ? fill.alphaF() : 1.0;
2886 if ( hasDefaultFillColor )
2890 fill.setAlphaF( hasDefaultFillOpacity ? defaultFillOpacity : newOpacity );
2891 mChangeColorButton->setColor( fill );
2893 mChangeColorButton->setEnabled( hasFillParam );
2894 mChangeColorButton->setAllowOpacity( hasFillOpacityParam );
2897 QColor stroke = mChangeStrokeColorButton->color();
2898 double newOpacity = hasStrokeOpacityParam ? stroke.alphaF() : 1.0;
2899 if ( hasDefaultStrokeColor )
2901 stroke = defaultStroke;
2903 stroke.setAlphaF( hasDefaultStrokeOpacity ? defaultStrokeOpacity : newOpacity );
2904 mChangeStrokeColorButton->setColor( stroke );
2906 mChangeStrokeColorButton->setEnabled( hasStrokeParam );
2907 mChangeStrokeColorButton->setAllowOpacity( hasStrokeOpacityParam );
2908 if ( hasDefaultStrokeWidth && resetValues )
2910 mStrokeWidthSpinBox->setValue( defaultStrokeWidth );
2912 mStrokeWidthSpinBox->setEnabled( hasStrokeWidthParam );
2915 void QgsSVGFillSymbolLayerWidget::mChangeColorButton_colorChanged(
const QColor &color )
2926 void QgsSVGFillSymbolLayerWidget::mChangeStrokeColorButton_colorChanged(
const QColor &color )
2937 void QgsSVGFillSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
2946 void QgsSVGFillSymbolLayerWidget::mTextureWidthUnitWidget_changed()
2956 void QgsSVGFillSymbolLayerWidget::mSvgStrokeWidthUnitWidget_changed()
2972 connect( mAngleSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged );
2973 connect( mDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged );
2974 connect( mOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged );
2981 mOffsetSpinBox->setClearValue( 0 );
2982 mAngleSpinBox->setClearValue( 0 );
2987 if ( layer->
layerType() != QLatin1String(
"LinePatternFill" ) )
2996 mAngleSpinBox->blockSignals(
true );
2998 mAngleSpinBox->blockSignals(
false );
2999 mDistanceSpinBox->blockSignals(
true );
3001 mDistanceSpinBox->blockSignals(
false );
3002 mOffsetSpinBox->blockSignals(
true );
3004 mOffsetSpinBox->blockSignals(
false );
3007 mDistanceUnitWidget->blockSignals(
true );
3010 mDistanceUnitWidget->blockSignals(
false );
3011 mOffsetUnitWidget->blockSignals(
true );
3014 mOffsetUnitWidget->blockSignals(
false );
3026 void QgsLinePatternFillSymbolLayerWidget::mAngleSpinBox_valueChanged(
double d )
3035 void QgsLinePatternFillSymbolLayerWidget::mDistanceSpinBox_valueChanged(
double d )
3044 void QgsLinePatternFillSymbolLayerWidget::mOffsetSpinBox_valueChanged(
double d )
3053 void QgsLinePatternFillSymbolLayerWidget::mDistanceUnitWidget_changed()
3063 void QgsLinePatternFillSymbolLayerWidget::mOffsetUnitWidget_changed()
3079 connect( mHorizontalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged );
3080 connect( mVerticalDistanceSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged );
3081 connect( mHorizontalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged );
3082 connect( mVerticalDisplacementSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged );
3083 connect( mHorizontalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged );
3084 connect( mVerticalOffsetSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged );
3085 connect( mHorizontalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed );
3086 connect( mVerticalDistanceUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed );
3087 connect( mHorizontalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed );
3088 connect( mVerticalDisplacementUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed );
3089 connect( mHorizontalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed );
3090 connect( mVerticalOffsetUnitWidget, &
QgsUnitSelectionWidget::changed,
this, &QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed );
3108 if ( !layer || layer->
layerType() != QLatin1String(
"PointPatternFill" ) )
3121 mHorizontalDistanceUnitWidget->blockSignals(
true );
3124 mHorizontalDistanceUnitWidget->blockSignals(
false );
3125 mVerticalDistanceUnitWidget->blockSignals(
true );
3128 mVerticalDistanceUnitWidget->blockSignals(
false );
3129 mHorizontalDisplacementUnitWidget->blockSignals(
true );
3132 mHorizontalDisplacementUnitWidget->blockSignals(
false );
3133 mVerticalDisplacementUnitWidget->blockSignals(
true );
3136 mVerticalDisplacementUnitWidget->blockSignals(
false );
3137 mHorizontalOffsetUnitWidget->blockSignals(
true );
3140 mHorizontalOffsetUnitWidget->blockSignals(
false );
3141 mVerticalOffsetUnitWidget->blockSignals(
true );
3144 mVerticalOffsetUnitWidget->blockSignals(
false );
3159 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceSpinBox_valueChanged(
double d )
3168 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceSpinBox_valueChanged(
double d )
3177 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementSpinBox_valueChanged(
double d )
3186 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementSpinBox_valueChanged(
double d )
3195 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetSpinBox_valueChanged(
double d )
3204 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetSpinBox_valueChanged(
double d )
3213 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDistanceUnitWidget_changed()
3223 void QgsPointPatternFillSymbolLayerWidget::mVerticalDistanceUnitWidget_changed()
3233 void QgsPointPatternFillSymbolLayerWidget::mHorizontalDisplacementUnitWidget_changed()
3243 void QgsPointPatternFillSymbolLayerWidget::mVerticalDisplacementUnitWidget_changed()
3253 void QgsPointPatternFillSymbolLayerWidget::mHorizontalOffsetUnitWidget_changed()
3263 void QgsPointPatternFillSymbolLayerWidget::mVerticalOffsetUnitWidget_changed()
3284 connect( mStrokeWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged );
3285 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3286 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3296 scrollArea->setVerticalOnly(
true );
3298 btnColor->setAllowOpacity(
true );
3299 btnColor->setColorDialogTitle( tr(
"Select Symbol Fill Color" ) );
3300 btnColor->setContext( QStringLiteral(
"symbology" ) );
3301 btnStrokeColor->setAllowOpacity(
true );
3302 btnStrokeColor->setColorDialogTitle( tr(
"Select Symbol Stroke Color" ) );
3303 btnStrokeColor->setContext( QStringLiteral(
"symbology" ) );
3305 mColorDDBtn->registerLinkedWidget( btnColor );
3306 mStrokeColorDDBtn->registerLinkedWidget( btnStrokeColor );
3308 spinOffsetX->setClearValue( 0.0 );
3309 spinOffsetY->setClearValue( 0.0 );
3310 spinAngle->setClearValue( 0.0 );
3316 mSizeDDBtn->setSymbol( mAssistantPreviewSymbol );
3320 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3323 connect( cboJoinStyle,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged );
3325 connect( spinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3326 connect( spinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsFontMarkerSymbolLayerWidget::setOffset );
3335 if ( layer->
layerType() != QLatin1String(
"FontMarker" ) )
3358 mCharPreview->setFont( layerFont );
3364 mSizeUnitWidget->blockSignals(
true );
3367 mSizeUnitWidget->blockSignals(
false );
3369 mStrokeWidthUnitWidget->blockSignals(
true );
3372 mStrokeWidthUnitWidget->blockSignals(
false );
3374 mOffsetUnitWidget->blockSignals(
true );
3377 mOffsetUnitWidget->blockSignals(
false );
3396 updateAssistantSymbol();
3408 mCharPreview->setFont( font );
3439 mCharPreview->setText( text );
3441 if ( text.isEmpty() )
3445 QString character = text;
3446 if ( text.contains( QRegularExpression( QStringLiteral(
"^0x[0-9a-fA-F]{1,4}$" ) ) ) )
3449 unsigned int value = text.toUInt( &ok, 0 );
3452 character = QChar( value );
3453 mCharPreview->setText( character );
3474 if (
mLayer->
character().length() > 1 || QGuiApplication::keyboardModifiers() & Qt::ControlModifier )
3476 mCharLineEdit->insert( chr );
3482 mCharPreview->setText( chr );
3486 void QgsFontMarkerSymbolLayerWidget::setOffset()
3488 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );
3492 void QgsFontMarkerSymbolLayerWidget::penJoinStyleChanged()
3498 void QgsFontMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3508 void QgsFontMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3518 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthUnitWidget_changed()
3528 void QgsFontMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3537 void QgsFontMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3546 void QgsFontMarkerSymbolLayerWidget::mStrokeWidthSpinBox_valueChanged(
double d )
3555 void QgsFontMarkerSymbolLayerWidget::updateAssistantSymbol()
3557 for (
int i = mAssistantPreviewSymbol->symbolLayerCount() - 1 ; i >= 0; --i )
3559 mAssistantPreviewSymbol->deleteSymbolLayer( i );
3561 mAssistantPreviewSymbol->appendSymbolLayer(
mLayer->
clone() );
3564 mAssistantPreviewSymbol->setDataDefinedSize( ddSize );
3576 connect( mDrawInsideCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged );
3577 connect( mDrawAllPartsCheckBox, &QCheckBox::stateChanged,
this, &QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged );
3582 if ( layer->
layerType() != QLatin1String(
"CentroidFill" ) )
3598 void QgsCentroidFillSymbolLayerWidget::mDrawInsideCheckBox_stateChanged(
int state )
3604 void QgsCentroidFillSymbolLayerWidget::mDrawAllPartsCheckBox_stateChanged(
int state )
3619 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3623 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setAngle );
3625 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setWidth );
3626 connect( mHeightSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setHeight );
3634 mSpinOffsetX->setClearValue( 0.0 );
3635 mSpinOffsetY->setClearValue( 0.0 );
3636 mRotationSpinBox->setClearValue( 0.0 );
3638 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3639 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::setOffset );
3642 connect( mHorizontalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged );
3643 connect( mVerticalAnchorComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged );
3653 if ( layer->
layerType() != QLatin1String(
"RasterMarker" ) )
3664 mHeightSpinBox->blockSignals(
true );
3665 if ( preservedAspectRatio )
3674 mHeightSpinBox->blockSignals(
false );
3675 whileBlocking( mLockAspectRatio )->setLocked( preservedAspectRatio );
3683 mSizeUnitWidget->blockSignals(
true );
3686 mSizeUnitWidget->blockSignals(
false );
3687 mOffsetUnitWidget->blockSignals(
true );
3690 mOffsetUnitWidget->blockSignals(
false );
3705 updatePreviewImage();
3716 mImageSourceLineEdit->setMessageBar( context.
messageBar() );
3719 void QgsRasterMarkerSymbolLayerWidget::imageSourceChanged(
const QString &text )
3722 updatePreviewImage();
3726 void QgsRasterMarkerSymbolLayerWidget::updatePreviewImage()
3728 bool fitsInCache =
false;
3730 if ( image.isNull() )
3732 mLabelImagePreview->setPixmap( QPixmap() );
3736 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3737 previewImage.fill( Qt::transparent );
3738 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3740 p.begin( &previewImage );
3742 uchar pixDataRGB[] = { 150, 150, 150, 150,
3747 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3748 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
3749 QBrush checkerBrush;
3750 checkerBrush.setTexture( pix );
3751 p.fillRect( imageRect, checkerBrush );
3758 p.drawImage( imageRect.left(), imageRect.top(), image );
3760 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
3763 void QgsRasterMarkerSymbolLayerWidget::setWidth()
3766 double fixedAspectRatio = 0.0;
3767 mHeightSpinBox->blockSignals(
true );
3768 if ( defaultAspectRatio <= 0.0 )
3770 mHeightSpinBox->setValue( mWidthSpinBox->value() );
3772 else if ( mLockAspectRatio->locked() )
3774 mHeightSpinBox->setValue( mWidthSpinBox->value() * defaultAspectRatio );
3778 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3780 mHeightSpinBox->blockSignals(
false );
3786 void QgsRasterMarkerSymbolLayerWidget::setHeight()
3789 double fixedAspectRatio = 0.0;
3790 mWidthSpinBox->blockSignals(
true );
3791 if ( defaultAspectRatio <= 0.0 )
3793 mWidthSpinBox->setValue( mHeightSpinBox->value() );
3795 else if ( mLockAspectRatio->locked() )
3797 mWidthSpinBox->setValue( mHeightSpinBox->value() / defaultAspectRatio );
3801 fixedAspectRatio = mHeightSpinBox->value() / mWidthSpinBox->value();
3803 mWidthSpinBox->blockSignals(
false );
3809 void QgsRasterMarkerSymbolLayerWidget::setLockAspectRatio(
const bool locked )
3812 if ( defaultAspectRatio <= 0.0 )
3827 void QgsRasterMarkerSymbolLayerWidget::setAngle()
3833 void QgsRasterMarkerSymbolLayerWidget::setOpacity(
double value )
3837 updatePreviewImage();
3840 void QgsRasterMarkerSymbolLayerWidget::setOffset()
3842 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
3846 void QgsRasterMarkerSymbolLayerWidget::mSizeUnitWidget_changed()
3856 void QgsRasterMarkerSymbolLayerWidget::mOffsetUnitWidget_changed()
3866 void QgsRasterMarkerSymbolLayerWidget::mHorizontalAnchorComboBox_currentIndexChanged(
int index )
3875 void QgsRasterMarkerSymbolLayerWidget::mVerticalAnchorComboBox_currentIndexChanged(
int index )
3892 mImageSourceLineEdit->setLastPathSettingsKey( QStringLiteral(
"/UI/lastRasterMarkerImageDir" ) );
3896 connect( mRotationSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged );
3898 connect( mWidthSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged );
3905 mSpinOffsetX->setClearValue( 0.0 );
3906 mSpinOffsetY->setClearValue( 0.0 );
3907 mRotationSpinBox->setClearValue( 0.0 );
3909 connect( cboCoordinateMode,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRasterFillSymbolLayerWidget::setCoordinateMode );
3910 connect( mSpinOffsetX, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3911 connect( mSpinOffsetY, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRasterFillSymbolLayerWidget::offsetChanged );
3923 if ( layer->
layerType() != QLatin1String(
"RasterFill" ) )
3936 cboCoordinateMode->blockSignals(
true );
3940 cboCoordinateMode->setCurrentIndex( 1 );
3944 cboCoordinateMode->setCurrentIndex( 0 );
3947 cboCoordinateMode->blockSignals(
false );
3953 mOffsetUnitWidget->blockSignals(
true );
3956 mOffsetUnitWidget->blockSignals(
false );
3959 mWidthUnitWidget->blockSignals(
true );
3962 mWidthUnitWidget->blockSignals(
false );
3964 updatePreviewImage();
3977 void QgsRasterFillSymbolLayerWidget::imageSourceChanged(
const QString &text )
3980 updatePreviewImage();
3984 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
4001 void QgsRasterFillSymbolLayerWidget::opacityChanged(
double value )
4010 updatePreviewImage();
4013 void QgsRasterFillSymbolLayerWidget::offsetChanged()
4015 mLayer->
setOffset( QPointF( mSpinOffsetX->value(), mSpinOffsetY->value() ) );
4019 void QgsRasterFillSymbolLayerWidget::mOffsetUnitWidget_changed()
4030 void QgsRasterFillSymbolLayerWidget::mRotationSpinBox_valueChanged(
double d )
4039 void QgsRasterFillSymbolLayerWidget::mWidthUnitWidget_changed()
4050 void QgsRasterFillSymbolLayerWidget::mWidthSpinBox_valueChanged(
double d )
4060 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
4062 bool fitsInCache =
false;
4064 if ( image.isNull() )
4066 mLabelImagePreview->setPixmap( QPixmap() );
4070 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
4071 previewImage.fill( Qt::transparent );
4072 QRect imageRect( ( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
4074 p.begin( &previewImage );
4076 uchar pixDataRGB[] = { 150, 150, 150, 150,
4081 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
4082 QPixmap pix = QPixmap::fromImage( img.scaled( 8, 8 ) );
4083 QBrush checkerBrush;
4084 checkerBrush.setTexture( pix );
4085 p.fillRect( imageRect, checkerBrush );
4092 p.drawImage( imageRect.left(), imageRect.top(), image );
4094 mLabelImagePreview->setPixmap( QPixmap::fromImage( previewImage ) );
4103 modificationExpressionSelector->setMultiLine(
true );
4104 modificationExpressionSelector->setLayer( const_cast<QgsVectorLayer *>( vl ) );
4105 modificationExpressionSelector->registerExpressionContextGenerator(
this );
4110 connect( cbxGeometryType,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType );
4117 cbxGeometryType->setCurrentIndex( cbxGeometryType->findData( mLayer->
symbolType() ) );
4125 void QgsGeometryGeneratorSymbolLayerWidget::updateExpression(
const QString &
string )
4132 void QgsGeometryGeneratorSymbolLayerWidget::updateSymbolType()
4134 mLayer->
setSymbolType( static_cast<QgsSymbol::SymbolType>( cbxGeometryType->currentData().toInt() ) );
4152 mPointCountSpinBox->setShowClearButton(
true );
4153 mPointCountSpinBox->setClearValue( 100 );
4154 mSeedSpinBox->setShowClearButton(
true );
4155 mSeedSpinBox->setClearValue( 0 );
4157 connect( mCountMethodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged );
4158 connect( mPointCountSpinBox, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::countChanged );
4159 connect( mDensityAreaSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged );
4160 connect( mSeedSpinBox, static_cast <
void ( QSpinBox::* )(
int ) > ( &QSpinBox::valueChanged ),
this, &QgsRandomMarkerFillSymbolLayerWidget::seedChanged );
4161 connect( mClipPointsCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
4178 if ( !layer || layer->
layerType() != QLatin1String(
"RandomMarkerFill" ) )
4188 bool showDensityBasedCountWidgets =
false;
4192 showDensityBasedCountWidgets =
true;
4197 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4198 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4199 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4200 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4204 mDensityAreaUnitWidget->blockSignals(
true );
4207 mDensityAreaUnitWidget->blockSignals(
false );
4220 void QgsRandomMarkerFillSymbolLayerWidget::countMethodChanged(
int )
4223 bool showDensityBasedCountWidgets =
false;
4224 switch ( static_cast< QgsRandomMarkerFillSymbolLayer::CountMethod >( mCountMethodComboBox->currentData().toInt() ) )
4227 showDensityBasedCountWidgets =
true;
4232 mDensityAreaLabel->setVisible( showDensityBasedCountWidgets );
4233 mDensityAreaSpinBox->setVisible( showDensityBasedCountWidgets );
4234 mDensityAreaUnitWidget->setVisible( showDensityBasedCountWidgets );
4235 mDensityAreaDdbtn->setVisible( showDensityBasedCountWidgets );
4239 mLayer->
setCountMethod( static_cast< QgsRandomMarkerFillSymbolLayer::CountMethod >( mCountMethodComboBox->currentData().toInt() ) );
4244 void QgsRandomMarkerFillSymbolLayerWidget::countChanged(
int d )
4253 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaChanged(
double d )
4262 void QgsRandomMarkerFillSymbolLayerWidget::densityAreaUnitChanged()
4272 void QgsRandomMarkerFillSymbolLayerWidget::seedChanged(
int d )
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 setPointCount(int count)
Sets the count of random points to render in the fill.
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.
Whether markers should be clipped to polygon boundaries.
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.
Q_INVOKABLE 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.
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
QColor strokeColor() const override
Returns the marker's stroke color.
A fill symbol layer which places markers at random locations within polygons.
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.
QgsUnitTypes::RenderUnit densityAreaUnit() const
Returns the units for the density area.
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.
CountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
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.
void setCountMethod(CountMethod method)
Sets the count method used to randomly fill the polygon.
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].
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
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 setDensityArea(double area)
Sets the density area used to count the number of points to randomly fill the polygon.
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...
double densityArea() const
Returns the density area used to count the number of points to randomly fill the polygon.
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 setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
int pointCount() const
Returns the count of random points to render in the fill.
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.
The point count is part of a marker density count.
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
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.
unsigned long seed() const
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be...
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.
The point count is used as an absolute count of markers.
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 setDensityAreaUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the density area.
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.
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
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.