Skip to content

Commit dd0ddd5

Browse files
committed
[styledock] Connect missing signals for order and effects
1 parent b5696a8 commit dd0ddd5

File tree

4 files changed

+17
-58
lines changed

4 files changed

+17
-58
lines changed

src/app/qgsmapstylingwidget.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,6 @@ void QgsMapStylingWidget::layerAboutToBeRemoved( QgsMapLayer* layer )
368368
}
369369
}
370370

371-
void QgsMapStylingWidget::syncWidgetState()
372-
{
373-
QWidget* current = mWidgetArea->widget();
374-
375-
if ( QgsRendererV2PropertiesDialog* widget = qobject_cast<QgsRendererV2PropertiesDialog*>( current ) )
376-
{
377-
widget->syncToLayer();
378-
}
379-
}
380-
381371
void QgsMapStylingWidget::pushUndoItem( const QString &name )
382372
{
383373
QString errorMsg;

src/app/qgsmapstylingwidget.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget, private Ui::QgsMapStyling
8585
private slots:
8686
void updateCurrentWidgetLayer();
8787
void layerAboutToBeRemoved( QgsMapLayer* layer );
88-
void syncWidgetState();
8988

9089
private:
9190
void pushUndoItem( const QString& name );

src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ QgsRendererV2PropertiesDialog::QgsRendererV2PropertiesDialog( QgsVectorLayer* la
120120
connect( btnOrderBy, SIGNAL( clicked( bool ) ), this, SLOT( showOrderByDialog() ) );
121121

122122
syncToLayer();
123+
124+
QList<QWidget*> widgets;
125+
widgets << mLayerTransparencySpnBx
126+
<< cboRenderers
127+
<< checkboxEnableOrderBy
128+
<< lineEditOrderBy
129+
<< mBlendModeComboBox
130+
<< mFeatureBlendComboBox
131+
<< mEffectWidget;
132+
133+
134+
connectValueChanged( widgets, SIGNAL( widgetChanged() ) );
123135
}
124136

125137
void QgsRendererV2PropertiesDialog::connectValueChanged( QList<QWidget *> widgets, const char *slot )
@@ -158,49 +170,13 @@ void QgsRendererV2PropertiesDialog::connectValueChanged( QList<QWidget *> widget
158170
else if ( QLineEdit* w = qobject_cast<QLineEdit*>( widget ) )
159171
{
160172
connect( w, SIGNAL( textEdited( QString ) ), this, slot );
173+
connect( w, SIGNAL( textChanged( QString ) ), this, slot );
161174
}
162-
}
163-
}
164-
165-
void QgsRendererV2PropertiesDialog::disconnectValueChanged( QList<QWidget *> widgets, const char *slot )
166-
{
167-
Q_FOREACH ( QWidget* widget, widgets )
168-
{
169-
if ( QgsDataDefinedButton* w = qobject_cast<QgsDataDefinedButton*>( widget ) )
170-
{
171-
disconnect( w, SIGNAL( dataDefinedActivated( bool ) ), this, slot );
172-
disconnect( w, SIGNAL( dataDefinedChanged( QString ) ), this, slot );
173-
}
174-
else if ( QgsFieldExpressionWidget* w = qobject_cast<QgsFieldExpressionWidget*>( widget ) )
175-
{
176-
disconnect( w, SIGNAL( fieldChanged( QString ) ), this, slot );
177-
}
178-
else if ( QComboBox* w = qobject_cast<QComboBox*>( widget ) )
179-
{
180-
disconnect( w, SIGNAL( currentIndexChanged( int ) ), this, slot );
181-
}
182-
else if ( QSpinBox* w = qobject_cast<QSpinBox*>( widget ) )
183-
{
184-
disconnect( w, SIGNAL( valueChanged( int ) ), this, slot );
185-
}
186-
else if ( QDoubleSpinBox* w = qobject_cast<QDoubleSpinBox*>( widget ) )
187-
{
188-
disconnect( w , SIGNAL( valueChanged( double ) ), this, slot );
189-
}
190-
else if ( QgsColorButtonV2* w = qobject_cast<QgsColorButtonV2*>( widget ) )
191-
{
192-
disconnect( w, SIGNAL( colorChanged( QColor ) ), this, slot );
193-
}
194-
else if ( QCheckBox* w = qobject_cast<QCheckBox*>( widget ) )
175+
else if ( QgsEffectStackCompactWidget* w = qobject_cast<QgsEffectStackCompactWidget*>( widget ) )
195176
{
196-
disconnect( w, SIGNAL( toggled( bool ) ), this, slot );
197-
}
198-
else if ( QLineEdit* w = qobject_cast<QLineEdit*>( widget ) )
199-
{
200-
disconnect( w, SIGNAL( textEdited( QString ) ), this, slot );
177+
connect( w, SIGNAL( changed() ), this, slot );
201178
}
202179
}
203-
204180
}
205181

206182
QgsRendererV2PropertiesDialog::~QgsRendererV2PropertiesDialog()
@@ -312,8 +288,6 @@ void QgsRendererV2PropertiesDialog::onOK()
312288

313289
void QgsRendererV2PropertiesDialog::syncToLayer()
314290
{
315-
QgsDebugMsg( "SYNC TO LAYER!!" );
316-
disconnectValueChanged( findChildren<QWidget*>(), SIGNAL( widgetChanged() ) );
317291
// Blend mode
318292
mBlendModeComboBox->setBlendMode( mLayer->blendMode() );
319293

@@ -324,7 +298,6 @@ void QgsRendererV2PropertiesDialog::syncToLayer()
324298
mLayerTransparencySlider->setValue( mLayer->layerTransparency() );
325299
mLayerTransparencySpnBx->setValue( mLayer->layerTransparency() );
326300

327-
QgsDebugMsg( QString( "VALUE: %1" ).arg( mLayer->layerTransparency() ) );
328301
//paint effect widget
329302
if ( mLayer->rendererV2() )
330303
{
@@ -362,7 +335,6 @@ void QgsRendererV2PropertiesDialog::syncToLayer()
362335
// no renderer found... this mustn't happen
363336
Q_ASSERT( rendererIdx != -1 && "there must be a renderer!" );
364337

365-
connectValueChanged( findChildren<QWidget*>(), SIGNAL( widgetChanged() ) );
366338
}
367339

368340
void QgsRendererV2PropertiesDialog::showOrderByDialog()

src/gui/symbology-ng/qgsrendererv2propertiesdialog.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ class GUI_EXPORT QgsRendererV2PropertiesDialog : public QDialog, private Ui::Qgs
7272
//! Apply and accept the changes for the dialog.
7373
void onOK();
7474

75-
void syncToLayer();
76-
7775
private slots:
7876
void showOrderByDialog();
7977

8078
void changeOrderBy( const QgsFeatureRequest::OrderBy& orderBy, bool orderByEnabled );
8179

8280
void updateUIState( bool hidden );
8381

82+
void syncToLayer();
83+
8484
protected:
8585
/**
8686
* Connect the given slot to the value changed event for the set of widgets
@@ -92,8 +92,6 @@ class GUI_EXPORT QgsRendererV2PropertiesDialog : public QDialog, private Ui::Qgs
9292
*/
9393
void connectValueChanged( QList<QWidget *> widgets, const char *slot );
9494

95-
void disconnectValueChanged( QList<QWidget *> widgets, const char *slot );
96-
9795
//! Reimplements dialog keyPress event so we can ignore it
9896
void keyPressEvent( QKeyEvent * event ) override;
9997

0 commit comments

Comments
 (0)