38 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsDrawSourceWidget::mDrawModeComboBox_currentIndexChanged );
39 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsDrawSourceWidget::mBlendCmbBx_currentIndexChanged );
46 if ( !effect || effect->
type() != QLatin1String(
"drawSource" ) )
55 void QgsDrawSourceWidget::initGui()
64 mOpacityWidget->setOpacity( mEffect->
opacity() );
65 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
66 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
68 blockSignals(
false );
71 void QgsDrawSourceWidget::blockSignals(
const bool block )
73 mOpacityWidget->blockSignals( block );
74 mBlendCmbBx->blockSignals( block );
75 mDrawModeComboBox->blockSignals( block );
78 void QgsDrawSourceWidget::opacityChanged(
double value )
87 void QgsDrawSourceWidget::mDrawModeComboBox_currentIndexChanged(
int index )
94 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
98 void QgsDrawSourceWidget::mBlendCmbBx_currentIndexChanged(
int index )
119 connect( mBlurTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mBlurTypeCombo_currentIndexChanged );
120 connect( mBlurStrengthSpnBx,
static_cast< void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsBlurWidget::mBlurStrengthSpnBx_valueChanged );
122 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mDrawModeComboBox_currentIndexChanged );
123 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsBlurWidget::mBlendCmbBx_currentIndexChanged );
138 if ( !effect || effect->
type() != QLatin1String(
"blur" ) )
145 void QgsBlurWidget::initGui()
152 blockSignals(
true );
154 mBlurTypeCombo->setCurrentIndex( mBlurTypeCombo->findData( mEffect->
blurMethod() ) );
155 mBlurStrengthSpnBx->setValue( mEffect->
blurLevel() );
156 mOpacityWidget->setOpacity( mEffect->
opacity() );
157 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
158 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
160 blockSignals(
false );
163 void QgsBlurWidget::blockSignals(
const bool block )
165 mBlurTypeCombo->blockSignals( block );
166 mBlurStrengthSpnBx->blockSignals( block );
167 mOpacityWidget->blockSignals( block );
168 mBlendCmbBx->blockSignals( block );
169 mDrawModeComboBox->blockSignals( block );
172 void QgsBlurWidget::mBlurTypeCombo_currentIndexChanged(
int index )
184 mBlurStrengthSpnBx->setMaximum( 16 );
187 mBlurStrengthSpnBx->setMaximum( 200 );
194 void QgsBlurWidget::mBlurStrengthSpnBx_valueChanged(
double value )
203 void QgsBlurWidget::mBlurUnitWidget_changed()
215 void QgsBlurWidget::opacityChanged(
double value )
224 void QgsBlurWidget::mDrawModeComboBox_currentIndexChanged(
int index )
231 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
235 void QgsBlurWidget::mBlendCmbBx_currentIndexChanged(
int index )
256 connect( mShadowOffsetAngleSpnBx,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged );
257 connect( mShadowOffsetAngleDial, &QDial::valueChanged,
this, &QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged );
258 connect( mShadowOffsetSpnBx,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged );
261 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged );
262 connect( mShadowBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged );
263 connect( mShadowRadiuSpnBx,
static_cast< void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged );
266 mShadowColorBtn->setAllowOpacity(
false );
267 mShadowColorBtn->setColorDialogTitle( tr(
"Select Shadow Color" ) );
268 mShadowColorBtn->setContext( QStringLiteral(
"symbology" ) );
269 mShadowOffsetAngleSpnBx->setClearValue( 0 );
283 if ( !effect || ( effect->
type() != QLatin1String(
"dropShadow" ) && effect->
type() != QLatin1String(
"innerShadow" ) ) )
290 void QgsShadowEffectWidget::initGui()
297 blockSignals(
true );
299 mShadowOffsetAngleSpnBx->setValue( mEffect->
offsetAngle() );
300 mShadowOffsetAngleDial->setValue( mEffect->
offsetAngle() );
302 mOffsetUnitWidget->setUnit( mEffect->
offsetUnit() );
304 mShadowRadiuSpnBx->setValue( mEffect->
blurLevel() );
305 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
307 mOpacityWidget->setOpacity( mEffect->
opacity() );
308 mShadowColorBtn->setColor( mEffect->
color() );
309 mShadowBlendCmbBx->setBlendMode( mEffect->
blendMode() );
310 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
312 blockSignals(
false );
315 void QgsShadowEffectWidget::blockSignals(
const bool block )
317 mShadowOffsetAngleSpnBx->blockSignals( block );
318 mShadowOffsetAngleDial->blockSignals( block );
319 mShadowOffsetSpnBx->blockSignals( block );
320 mOffsetUnitWidget->blockSignals( block );
321 mShadowRadiuSpnBx->blockSignals( block );
322 mBlurUnitWidget->blockSignals( block );
323 mOpacityWidget->blockSignals( block );
324 mShadowColorBtn->blockSignals( block );
325 mShadowBlendCmbBx->blockSignals( block );
326 mDrawModeComboBox->blockSignals( block );
329 void QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged(
int value )
331 mShadowOffsetAngleDial->blockSignals(
true );
332 mShadowOffsetAngleDial->setValue( value );
333 mShadowOffsetAngleDial->blockSignals(
false );
342 void QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged(
int value )
344 mShadowOffsetAngleSpnBx->setValue( value );
347 void QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged(
double value )
356 void QgsShadowEffectWidget::mOffsetUnitWidget_changed()
368 void QgsShadowEffectWidget::opacityChanged(
double value )
377 void QgsShadowEffectWidget::mShadowColorBtn_colorChanged(
const QColor &color )
386 void QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged(
double value )
395 void QgsShadowEffectWidget::mBlurUnitWidget_changed()
407 void QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
414 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
418 void QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged(
int index )
425 mEffect->
setBlendMode( mShadowBlendCmbBx->blendMode() );
440 connect( mSpreadSpnBx,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mSpreadSpnBx_valueChanged );
443 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mBlendCmbBx_currentIndexChanged );
444 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mDrawModeComboBox_currentIndexChanged );
445 connect( mBlurRadiusSpnBx,
static_cast< void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mBlurRadiusSpnBx_valueChanged );
448 mColorBtn->setAllowOpacity(
false );
449 mColorBtn->setColorDialogTitle( tr(
"Select Glow Color" ) );
450 mColorBtn->setContext( QStringLiteral(
"symbology" ) );
457 btnColorRamp->setShowGradientOnly(
true );
462 connect( radioSingleColor, &QAbstractButton::toggled,
this, &QgsGlowWidget::colorModeChanged );
468 if ( !effect || ( effect->
type() != QLatin1String(
"outerGlow" ) && effect->
type() != QLatin1String(
"innerGlow" ) ) )
475 void QgsGlowWidget::initGui()
482 blockSignals(
true );
484 mSpreadSpnBx->setValue( mEffect->
spread() );
485 mSpreadUnitWidget->setUnit( mEffect->
spreadUnit() );
487 mBlurRadiusSpnBx->setValue( mEffect->
blurLevel() );
488 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
490 mOpacityWidget->setOpacity( mEffect->
opacity() );
491 mColorBtn->setColor( mEffect->
color() );
492 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
494 if ( mEffect->
ramp() )
496 btnColorRamp->setColorRamp( mEffect->
ramp() );
503 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
505 blockSignals(
false );
508 void QgsGlowWidget::blockSignals(
const bool block )
510 mSpreadSpnBx->blockSignals( block );
511 mSpreadUnitWidget->blockSignals( block );
512 mBlurRadiusSpnBx->blockSignals( block );
513 mOpacityWidget->blockSignals( block );
514 mColorBtn->blockSignals( block );
515 mBlendCmbBx->blockSignals( block );
516 btnColorRamp->blockSignals( block );
517 radioSingleColor->blockSignals( block );
518 radioColorRamp->blockSignals( block );
519 mDrawModeComboBox->blockSignals( block );
522 void QgsGlowWidget::colorModeChanged()
529 if ( radioSingleColor->isChecked() )
536 mEffect->
setRamp( btnColorRamp->colorRamp() );
541 void QgsGlowWidget::mSpreadSpnBx_valueChanged(
double value )
550 void QgsGlowWidget::mSpreadUnitWidget_changed()
562 void QgsGlowWidget::opacityChanged(
double value )
571 void QgsGlowWidget::mColorBtn_colorChanged(
const QColor &color )
580 void QgsGlowWidget::mBlurRadiusSpnBx_valueChanged(
double value )
589 void QgsGlowWidget::mBlurUnitWidget_changed()
601 void QgsGlowWidget::mBlendCmbBx_currentIndexChanged(
int index )
612 void QgsGlowWidget::mDrawModeComboBox_currentIndexChanged(
int index )
619 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
623 void QgsGlowWidget::applyColorRamp()
647 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsTransformWidget::mDrawModeComboBox_currentIndexChanged );
648 connect( mSpinTranslateX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateX_valueChanged );
649 connect( mSpinTranslateY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateY_valueChanged );
651 connect( mReflectXCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectXCheckBox_stateChanged );
652 connect( mReflectYCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectYCheckBox_stateChanged );
653 connect( mSpinShearX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearX_valueChanged );
654 connect( mSpinShearY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearY_valueChanged );
655 connect( mSpinScaleX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleX_valueChanged );
656 connect( mSpinScaleY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleY_valueChanged );
657 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mRotationSpinBox_valueChanged );
661 mSpinTranslateX->setClearValue( 0 );
662 mSpinTranslateY->setClearValue( 0 );
663 mRotationSpinBox->setClearValue( 0 );
664 mSpinShearX->setClearValue( 0 );
665 mSpinShearY->setClearValue( 0 );
666 mSpinScaleX->setClearValue( 100.0 );
667 mSpinScaleY->setClearValue( 100.0 );
675 if ( !effect || effect->
type() != QLatin1String(
"transform" ) )
682 void QgsTransformWidget::initGui()
689 blockSignals(
true );
691 mReflectXCheckBox->setChecked( mEffect->
reflectX() );
692 mReflectYCheckBox->setChecked( mEffect->
reflectY() );
693 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
694 mSpinTranslateX->setValue( mEffect->
translateX() );
695 mSpinTranslateY->setValue( mEffect->
translateY() );
698 mSpinShearX->setValue( mEffect->
shearX() );
699 mSpinShearY->setValue( mEffect->
shearY() );
700 mSpinScaleX->setValue( mEffect->
scaleX() * 100.0 );
701 mSpinScaleY->setValue( mEffect->
scaleY() * 100.0 );
702 mRotationSpinBox->setValue( mEffect->
rotation() );
704 blockSignals(
false );
707 void QgsTransformWidget::blockSignals(
const bool block )
709 mDrawModeComboBox->blockSignals( block );
710 mTranslateUnitWidget->blockSignals( block );
711 mSpinTranslateX->blockSignals( block );
712 mSpinTranslateY->blockSignals( block );
713 mReflectXCheckBox->blockSignals( block );
714 mReflectYCheckBox->blockSignals( block );
715 mSpinShearX->blockSignals( block );
716 mSpinShearY->blockSignals( block );
717 mSpinScaleX->blockSignals( block );
718 mSpinScaleY->blockSignals( block );
719 mRotationSpinBox->blockSignals( block );
723 void QgsTransformWidget::mDrawModeComboBox_currentIndexChanged(
int index )
730 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
734 void QgsTransformWidget::mSpinTranslateX_valueChanged(
double value )
743 void QgsTransformWidget::mSpinTranslateY_valueChanged(
double value )
752 void QgsTransformWidget::mTranslateUnitWidget_changed()
764 void QgsTransformWidget::mReflectXCheckBox_stateChanged(
int state )
773 void QgsTransformWidget::mReflectYCheckBox_stateChanged(
int state )
782 void QgsTransformWidget::mSpinShearX_valueChanged(
double value )
791 void QgsTransformWidget::mSpinShearY_valueChanged(
double value )
800 void QgsTransformWidget::mSpinScaleX_valueChanged(
double value )
809 void QgsTransformWidget::mSpinScaleY_valueChanged(
double value )
818 void QgsTransformWidget::mRotationSpinBox_valueChanged(
double value )
837 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged );
838 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged );
839 connect( mBrightnessSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mBrightnessSpinBox_valueChanged );
840 connect( mContrastSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mContrastSpinBox_valueChanged );
841 connect( mSaturationSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mSaturationSpinBox_valueChanged );
842 connect( mColorizeStrengthSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged );
843 connect( mColorizeCheck, &QCheckBox::stateChanged,
this, &QgsColorEffectWidget::mColorizeCheck_stateChanged );
845 connect( mGrayscaleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged );
847 mBrightnessSpinBox->setClearValue( 0 );
848 mContrastSpinBox->setClearValue( 0 );
849 mSaturationSpinBox->setClearValue( 0 );
850 mColorizeColorButton->setAllowOpacity(
false );
864 if ( !effect || effect->
type() != QLatin1String(
"color" ) )
871 void QgsColorEffectWidget::initGui()
878 blockSignals(
true );
880 mSliderBrightness->setValue( mEffect->
brightness() );
881 mSliderContrast->setValue( mEffect->
contrast() );
882 mSliderSaturation->setValue( ( mEffect->
saturation() - 1.0 ) * 100.0 );
883 mColorizeCheck->setChecked( mEffect->
colorizeOn() );
886 int grayscaleIdx = mGrayscaleCombo->findData( QVariant( (
int ) mEffect->
grayscaleMode() ) );
887 mGrayscaleCombo->setCurrentIndex( grayscaleIdx == -1 ? 0 : grayscaleIdx );
888 mOpacityWidget->setOpacity( mEffect->
opacity() );
889 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
890 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
891 enableColorizeControls( mEffect->
colorizeOn() );
893 blockSignals(
false );
896 void QgsColorEffectWidget::blockSignals(
const bool block )
898 mBrightnessSpinBox->blockSignals( block );
899 mContrastSpinBox->blockSignals( block );
900 mSaturationSpinBox->blockSignals( block );
901 mColorizeStrengthSpinBox->blockSignals( block );
902 mColorizeCheck->blockSignals( block );
903 mColorizeColorButton->blockSignals( block );
904 mGrayscaleCombo->blockSignals( block );
905 mOpacityWidget->blockSignals( block );
906 mBlendCmbBx->blockSignals( block );
907 mDrawModeComboBox->blockSignals( block );
910 void QgsColorEffectWidget::enableColorizeControls(
const bool enable )
912 mSliderColorizeStrength->setEnabled( enable );
913 mColorizeStrengthSpinBox->setEnabled( enable );
914 mColorizeColorButton->setEnabled( enable );
917 void QgsColorEffectWidget::opacityChanged(
double value )
926 void QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged(
int index )
937 void QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
944 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
948 void QgsColorEffectWidget::mBrightnessSpinBox_valueChanged(
int value )
957 void QgsColorEffectWidget::mContrastSpinBox_valueChanged(
int value )
966 void QgsColorEffectWidget::mSaturationSpinBox_valueChanged(
int value )
975 void QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged(
int value )
984 void QgsColorEffectWidget::mColorizeCheck_stateChanged(
int state )
990 enableColorizeControls( state == Qt::Checked );
994 void QgsColorEffectWidget::mColorizeColorButton_colorChanged(
const QColor &color )
1003 void QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged(
int index )