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 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
163 blockSignals(
false );
166 void QgsBlurWidget::blockSignals(
const bool block )
168 mBlurTypeCombo->blockSignals( block );
169 mBlurStrengthSpnBx->blockSignals( block );
170 mOpacityWidget->blockSignals( block );
171 mBlendCmbBx->blockSignals( block );
172 mDrawModeComboBox->blockSignals( block );
175 void QgsBlurWidget::mBlurTypeCombo_currentIndexChanged(
int index )
187 mBlurStrengthSpnBx->setMaximum( 16 );
190 mBlurStrengthSpnBx->setMaximum( 200 );
197 void QgsBlurWidget::mBlurStrengthSpnBx_valueChanged(
double value )
206 void QgsBlurWidget::mBlurUnitWidget_changed()
218 void QgsBlurWidget::opacityChanged(
double value )
227 void QgsBlurWidget::mDrawModeComboBox_currentIndexChanged(
int index )
234 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
238 void QgsBlurWidget::mBlendCmbBx_currentIndexChanged(
int index )
259 connect( mShadowOffsetAngleSpnBx,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged );
260 connect( mShadowOffsetAngleDial, &QDial::valueChanged,
this, &QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged );
261 connect( mShadowOffsetSpnBx,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged );
264 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged );
265 connect( mShadowBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged );
266 connect( mShadowRadiuSpnBx,
static_cast< void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged );
269 mShadowColorBtn->setAllowOpacity(
false );
270 mShadowColorBtn->setColorDialogTitle( tr(
"Select Shadow Color" ) );
271 mShadowColorBtn->setContext( QStringLiteral(
"symbology" ) );
272 mShadowOffsetAngleSpnBx->setClearValue( 0 );
286 if ( !effect || ( effect->
type() != QLatin1String(
"dropShadow" ) && effect->
type() != QLatin1String(
"innerShadow" ) ) )
293 void QgsShadowEffectWidget::initGui()
300 blockSignals(
true );
302 mShadowOffsetAngleSpnBx->setValue( mEffect->
offsetAngle() );
303 mShadowOffsetAngleDial->setValue( mEffect->
offsetAngle() );
305 mOffsetUnitWidget->setUnit( mEffect->
offsetUnit() );
307 mShadowRadiuSpnBx->setValue( mEffect->
blurLevel() );
308 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
310 mOpacityWidget->setOpacity( mEffect->
opacity() );
311 mShadowColorBtn->setColor( mEffect->
color() );
312 mShadowBlendCmbBx->setBlendMode( mEffect->
blendMode() );
313 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
315 blockSignals(
false );
318 void QgsShadowEffectWidget::blockSignals(
const bool block )
320 mShadowOffsetAngleSpnBx->blockSignals( block );
321 mShadowOffsetAngleDial->blockSignals( block );
322 mShadowOffsetSpnBx->blockSignals( block );
323 mOffsetUnitWidget->blockSignals( block );
324 mShadowRadiuSpnBx->blockSignals( block );
325 mBlurUnitWidget->blockSignals( block );
326 mOpacityWidget->blockSignals( block );
327 mShadowColorBtn->blockSignals( block );
328 mShadowBlendCmbBx->blockSignals( block );
329 mDrawModeComboBox->blockSignals( block );
332 void QgsShadowEffectWidget::mShadowOffsetAngleSpnBx_valueChanged(
int value )
334 mShadowOffsetAngleDial->blockSignals(
true );
335 mShadowOffsetAngleDial->setValue( value );
336 mShadowOffsetAngleDial->blockSignals(
false );
345 void QgsShadowEffectWidget::mShadowOffsetAngleDial_valueChanged(
int value )
347 mShadowOffsetAngleSpnBx->setValue( value );
350 void QgsShadowEffectWidget::mShadowOffsetSpnBx_valueChanged(
double value )
359 void QgsShadowEffectWidget::mOffsetUnitWidget_changed()
371 void QgsShadowEffectWidget::opacityChanged(
double value )
380 void QgsShadowEffectWidget::mShadowColorBtn_colorChanged(
const QColor &color )
389 void QgsShadowEffectWidget::mShadowRadiuSpnBx_valueChanged(
double value )
398 void QgsShadowEffectWidget::mBlurUnitWidget_changed()
410 void QgsShadowEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
417 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
421 void QgsShadowEffectWidget::mShadowBlendCmbBx_currentIndexChanged(
int index )
428 mEffect->
setBlendMode( mShadowBlendCmbBx->blendMode() );
443 connect( mSpreadSpnBx,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mSpreadSpnBx_valueChanged );
446 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mBlendCmbBx_currentIndexChanged );
447 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGlowWidget::mDrawModeComboBox_currentIndexChanged );
448 connect( mBlurRadiusSpnBx,
static_cast< void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsGlowWidget::mBlurRadiusSpnBx_valueChanged );
451 mColorBtn->setAllowOpacity(
false );
452 mColorBtn->setColorDialogTitle( tr(
"Select Glow Color" ) );
453 mColorBtn->setContext( QStringLiteral(
"symbology" ) );
460 btnColorRamp->setShowGradientOnly(
true );
465 connect( radioSingleColor, &QAbstractButton::toggled,
this, &QgsGlowWidget::colorModeChanged );
471 if ( !effect || ( effect->
type() != QLatin1String(
"outerGlow" ) && effect->
type() != QLatin1String(
"innerGlow" ) ) )
478 void QgsGlowWidget::initGui()
485 blockSignals(
true );
487 mSpreadSpnBx->setValue( mEffect->
spread() );
488 mSpreadUnitWidget->setUnit( mEffect->
spreadUnit() );
490 mBlurRadiusSpnBx->setValue( mEffect->
blurLevel() );
491 mBlurUnitWidget->setUnit( mEffect->
blurUnit() );
493 mOpacityWidget->setOpacity( mEffect->
opacity() );
494 mColorBtn->setColor( mEffect->
color() );
495 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
497 if ( mEffect->
ramp() )
499 btnColorRamp->setColorRamp( mEffect->
ramp() );
506 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
508 blockSignals(
false );
511 void QgsGlowWidget::blockSignals(
const bool block )
513 mSpreadSpnBx->blockSignals( block );
514 mSpreadUnitWidget->blockSignals( block );
515 mBlurRadiusSpnBx->blockSignals( block );
516 mOpacityWidget->blockSignals( block );
517 mColorBtn->blockSignals( block );
518 mBlendCmbBx->blockSignals( block );
519 btnColorRamp->blockSignals( block );
520 radioSingleColor->blockSignals( block );
521 radioColorRamp->blockSignals( block );
522 mDrawModeComboBox->blockSignals( block );
525 void QgsGlowWidget::colorModeChanged()
532 if ( radioSingleColor->isChecked() )
539 mEffect->
setRamp( btnColorRamp->colorRamp() );
544 void QgsGlowWidget::mSpreadSpnBx_valueChanged(
double value )
553 void QgsGlowWidget::mSpreadUnitWidget_changed()
565 void QgsGlowWidget::opacityChanged(
double value )
574 void QgsGlowWidget::mColorBtn_colorChanged(
const QColor &color )
583 void QgsGlowWidget::mBlurRadiusSpnBx_valueChanged(
double value )
592 void QgsGlowWidget::mBlurUnitWidget_changed()
604 void QgsGlowWidget::mBlendCmbBx_currentIndexChanged(
int index )
615 void QgsGlowWidget::mDrawModeComboBox_currentIndexChanged(
int index )
622 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
626 void QgsGlowWidget::applyColorRamp()
650 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsTransformWidget::mDrawModeComboBox_currentIndexChanged );
651 connect( mSpinTranslateX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateX_valueChanged );
652 connect( mSpinTranslateY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinTranslateY_valueChanged );
654 connect( mReflectXCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectXCheckBox_stateChanged );
655 connect( mReflectYCheckBox, &QCheckBox::stateChanged,
this, &QgsTransformWidget::mReflectYCheckBox_stateChanged );
656 connect( mSpinShearX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearX_valueChanged );
657 connect( mSpinShearY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinShearY_valueChanged );
658 connect( mSpinScaleX,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleX_valueChanged );
659 connect( mSpinScaleY,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mSpinScaleY_valueChanged );
660 connect( mRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsTransformWidget::mRotationSpinBox_valueChanged );
664 mSpinTranslateX->setClearValue( 0 );
665 mSpinTranslateY->setClearValue( 0 );
666 mRotationSpinBox->setClearValue( 0 );
667 mSpinShearX->setClearValue( 0 );
668 mSpinShearY->setClearValue( 0 );
669 mSpinScaleX->setClearValue( 100.0 );
670 mSpinScaleY->setClearValue( 100.0 );
678 if ( !effect || effect->
type() != QLatin1String(
"transform" ) )
685 void QgsTransformWidget::initGui()
692 blockSignals(
true );
694 mReflectXCheckBox->setChecked( mEffect->
reflectX() );
695 mReflectYCheckBox->setChecked( mEffect->
reflectY() );
696 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
697 mSpinTranslateX->setValue( mEffect->
translateX() );
698 mSpinTranslateY->setValue( mEffect->
translateY() );
701 mSpinShearX->setValue( mEffect->
shearX() );
702 mSpinShearY->setValue( mEffect->
shearY() );
703 mSpinScaleX->setValue( mEffect->
scaleX() * 100.0 );
704 mSpinScaleY->setValue( mEffect->
scaleY() * 100.0 );
705 mRotationSpinBox->setValue( mEffect->
rotation() );
707 blockSignals(
false );
710 void QgsTransformWidget::blockSignals(
const bool block )
712 mDrawModeComboBox->blockSignals( block );
713 mTranslateUnitWidget->blockSignals( block );
714 mSpinTranslateX->blockSignals( block );
715 mSpinTranslateY->blockSignals( block );
716 mReflectXCheckBox->blockSignals( block );
717 mReflectYCheckBox->blockSignals( block );
718 mSpinShearX->blockSignals( block );
719 mSpinShearY->blockSignals( block );
720 mSpinScaleX->blockSignals( block );
721 mSpinScaleY->blockSignals( block );
722 mRotationSpinBox->blockSignals( block );
726 void QgsTransformWidget::mDrawModeComboBox_currentIndexChanged(
int index )
733 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
737 void QgsTransformWidget::mSpinTranslateX_valueChanged(
double value )
746 void QgsTransformWidget::mSpinTranslateY_valueChanged(
double value )
755 void QgsTransformWidget::mTranslateUnitWidget_changed()
767 void QgsTransformWidget::mReflectXCheckBox_stateChanged(
int state )
776 void QgsTransformWidget::mReflectYCheckBox_stateChanged(
int state )
785 void QgsTransformWidget::mSpinShearX_valueChanged(
double value )
794 void QgsTransformWidget::mSpinShearY_valueChanged(
double value )
803 void QgsTransformWidget::mSpinScaleX_valueChanged(
double value )
812 void QgsTransformWidget::mSpinScaleY_valueChanged(
double value )
821 void QgsTransformWidget::mRotationSpinBox_valueChanged(
double value )
840 connect( mBlendCmbBx,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged );
841 connect( mDrawModeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged );
842 connect( mBrightnessSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mBrightnessSpinBox_valueChanged );
843 connect( mContrastSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mContrastSpinBox_valueChanged );
844 connect( mSaturationSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mSaturationSpinBox_valueChanged );
845 connect( mColorizeStrengthSpinBox,
static_cast< void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged );
846 connect( mColorizeCheck, &QCheckBox::stateChanged,
this, &QgsColorEffectWidget::mColorizeCheck_stateChanged );
848 connect( mGrayscaleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged );
850 mBrightnessSpinBox->setClearValue( 0 );
851 mContrastSpinBox->setClearValue( 0 );
852 mSaturationSpinBox->setClearValue( 0 );
853 mColorizeStrengthSpinBox->setClearValue( 100 );
854 mColorizeColorButton->setAllowOpacity(
false );
868 if ( !effect || effect->
type() != QLatin1String(
"color" ) )
875 void QgsColorEffectWidget::initGui()
882 blockSignals(
true );
884 mSliderBrightness->setValue( mEffect->
brightness() );
885 mSliderContrast->setValue( mEffect->
contrast() );
886 mSliderSaturation->setValue( ( mEffect->
saturation() - 1.0 ) * 100.0 );
887 mColorizeCheck->setChecked( mEffect->
colorizeOn() );
890 const int grayscaleIdx = mGrayscaleCombo->findData( QVariant( (
int ) mEffect->
grayscaleMode() ) );
891 mGrayscaleCombo->setCurrentIndex( grayscaleIdx == -1 ? 0 : grayscaleIdx );
892 mOpacityWidget->setOpacity( mEffect->
opacity() );
893 mBlendCmbBx->setBlendMode( mEffect->
blendMode() );
894 mDrawModeComboBox->setDrawMode( mEffect->
drawMode() );
895 enableColorizeControls( mEffect->
colorizeOn() );
897 blockSignals(
false );
900 void QgsColorEffectWidget::blockSignals(
const bool block )
902 mBrightnessSpinBox->blockSignals( block );
903 mContrastSpinBox->blockSignals( block );
904 mSaturationSpinBox->blockSignals( block );
905 mColorizeStrengthSpinBox->blockSignals( block );
906 mColorizeCheck->blockSignals( block );
907 mColorizeColorButton->blockSignals( block );
908 mGrayscaleCombo->blockSignals( block );
909 mOpacityWidget->blockSignals( block );
910 mBlendCmbBx->blockSignals( block );
911 mDrawModeComboBox->blockSignals( block );
914 void QgsColorEffectWidget::enableColorizeControls(
const bool enable )
916 mSliderColorizeStrength->setEnabled( enable );
917 mColorizeStrengthSpinBox->setEnabled( enable );
918 mColorizeColorButton->setEnabled( enable );
921 void QgsColorEffectWidget::opacityChanged(
double value )
930 void QgsColorEffectWidget::mBlendCmbBx_currentIndexChanged(
int index )
941 void QgsColorEffectWidget::mDrawModeComboBox_currentIndexChanged(
int index )
948 mEffect->
setDrawMode( mDrawModeComboBox->drawMode() );
952 void QgsColorEffectWidget::mBrightnessSpinBox_valueChanged(
int value )
961 void QgsColorEffectWidget::mContrastSpinBox_valueChanged(
int value )
970 void QgsColorEffectWidget::mSaturationSpinBox_valueChanged(
int value )
979 void QgsColorEffectWidget::mColorizeStrengthSpinBox_valueChanged(
int value )
988 void QgsColorEffectWidget::mColorizeCheck_stateChanged(
int state )
994 enableColorizeControls( state == Qt::Checked );
998 void QgsColorEffectWidget::mColorizeColorButton_colorChanged(
const QColor &color )
1007 void QgsColorEffectWidget::mGrayscaleCombo_currentIndexChanged(
int index )