Skip to content
Permalink
Browse files
Flip panel connects to new style
  • Loading branch information
nyalldawson committed Mar 17, 2017
1 parent ecc4925 commit 7aff3e784c9621da770e7723570578c5c3780526
@@ -340,7 +340,7 @@ void QgsComposerArrowWidget::on_mLineStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateLineStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpLineStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerArrowWidget::cleanUpLineStyleSelector );
openPanel( d );
mArrow->beginCommand( tr( "Arrow line style changed" ) );
}
@@ -641,8 +641,8 @@ void QgsComposerMapGridWidget::on_mGridLineStyleButton_clicked()
symbolContext.setExpressionContext( &context );
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateGridLineStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpGridLineStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerMapGridWidget::updateGridLineStyleFromWidget );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapGridWidget::cleanUpGridLineStyleSelector );
openPanel( d );
mComposerMap->beginCommand( tr( "Grid line style changed" ) );
}
@@ -1652,7 +1652,7 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateOverviewFrameStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpOverviewFrameStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapWidget::cleanUpOverviewFrameStyleSelector );
openPanel( d );
mComposerMap->beginCommand( tr( "Overview frame style changed" ) );
}
@@ -68,7 +68,7 @@ void QgsComposerPolygonWidget::on_mPolygonStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolygonWidget::cleanUpStyleSelector );
openPanel( d );
mComposerPolygon->beginCommand( tr( "Polygon style changed" ) );
}
@@ -63,7 +63,7 @@ void QgsComposerPolylineWidget::on_mLineStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerPolylineWidget::cleanUpStyleSelector );
openPanel( d );
mComposerPolyline->beginCommand( tr( "Polyline style changed" ) );
}
@@ -117,7 +117,7 @@ void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerShapeWidget::cleanUpSymbolSelector );
openPanel( d );
mComposerShape->beginCommand( tr( "Shape style changed" ) );
}
@@ -548,7 +548,7 @@ void QgsCompositionWidget::on_mPageStyleButton_clicked()
d->setContext( symbolContext );

connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateStyleFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpStyleSelector( QgsPanelWidget * ) ) );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsCompositionWidget::cleanUpStyleSelector );
openPanel( d );
}

@@ -156,8 +156,8 @@ void QgsLabelingWidget::labelModeChanged( int index )

QgsRuleBasedLabelingWidget *ruleWidget = new QgsRuleBasedLabelingWidget( mLayer, mCanvas, this );
ruleWidget->setDockMode( dockMode() );
connect( ruleWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( ruleWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( ruleWidget, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );
connect( ruleWidget, &QgsRuleBasedLabelingWidget::widgetChanged, this, &QgsLabelingWidget::widgetChanged );
mWidget = ruleWidget;
mStackedWidget->addWidget( mWidget );
mStackedWidget->setCurrentWidget( mWidget );
@@ -356,7 +356,7 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
connect( styleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) );
QgsPanelWidgetWrapper *wrapper = new QgsPanelWidgetWrapper( styleWidget, mStackedWidget );
wrapper->setDockMode( true );
connect( styleWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), wrapper, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( styleWidget, &QgsRendererPropertiesDialog::showPanel, wrapper, &QgsPanelWidget::openPanel );
mWidgetStack->setMainPanel( wrapper );
break;
}
@@ -167,7 +167,7 @@ void QgsRuleBasedLabelingWidget::editRule( const QModelIndex &index )

QgsLabelingRulePropsWidget *widget = new QgsLabelingRulePropsWidget( rule, mLayer, this, mCanvas );
widget->setPanelTitle( tr( "Edit rule" ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedLabelingWidget::ruleWidgetPanelAccepted );
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
openPanel( widget );
}
@@ -1264,7 +1264,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
mRendererDialog = new QgsRendererPropertiesDialog( mLayer, QgsStyle::defaultStyle(), true, this );
mRendererDialog->setDockMode( false );
mRendererDialog->setMapCanvas( QgisApp::instance()->mapCanvas() );
connect( mRendererDialog, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mRendererDialog, &QgsRendererPropertiesDialog::showPanel, this, &QgsVectorLayerProperties::openPanel );
connect( mRendererDialog, SIGNAL( layerVariablesChanged() ), this, SLOT( updateVariableEditor() ) );

// display the menu to choose the output format (fix #5136)
@@ -467,7 +467,7 @@ void QgsEffectStackCompactWidget::showDialog()
widget->setPreviewPicture( *mPreviewPicture );
}
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( updateEffectLive() ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( updateAcceptWidget( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsEffectStackCompactWidget::updateAcceptWidget );
openPanel( widget );
}

@@ -38,8 +38,8 @@ void QgsPanelWidget::connectChildPanels( const QList<QgsPanelWidget *> &panels )

void QgsPanelWidget::connectChildPanel( QgsPanelWidget *panel )
{
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( panel, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );
connect( panel, &QgsPanelWidget::widgetChanged, this, &QgsPanelWidget::widgetChanged );
}

void QgsPanelWidget::setDockMode( bool dockMode )
@@ -29,13 +29,13 @@ QgsPanelWidgetStack::QgsPanelWidgetStack( QWidget *parent )
setupUi( this );
clear();

connect( mBackButton, SIGNAL( pressed() ), this, SLOT( acceptCurrentPanel() ) );
connect( mBackButton, &QAbstractButton::pressed, this, &QgsPanelWidgetStack::acceptCurrentPanel );
}

void QgsPanelWidgetStack::setMainPanel( QgsPanelWidget *panel )
{
// TODO Don't allow adding another main widget or else that would be strange for the user.
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( showPanel( QgsPanelWidget * ) ),
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidgetStack::showPanel,
// using unique connection because addMainPanel() may be called multiple times
// for a panel, so showPanel() slot could be invoked more times from one signal
Qt::UniqueConnection );
@@ -118,8 +118,8 @@ void QgsPanelWidgetStack::showPanel( QgsPanelWidget *panel )
{
mTitles.push( panel->panelTitle() );

connect( panel, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( closePanel( QgsPanelWidget * ) ) );
connect( panel, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( showPanel( QgsPanelWidget * ) ) );
connect( panel, &QgsPanelWidget::panelAccepted, this, &QgsPanelWidgetStack::closePanel );
connect( panel, &QgsPanelWidget::showPanel, this, &QgsPanelWidgetStack::showPanel );

int index = mStackedWidget->addWidget( panel );
mStackedWidget->setCurrentIndex( index );
@@ -544,7 +544,7 @@ void QgsCategorizedSymbolRendererWidget::changeCategorizedSymbol()
dlg->setContext( mContext );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

@@ -587,7 +587,7 @@ void QgsCategorizedSymbolRendererWidget::changeCategorySymbol()
QgsSymbolSelectorWidget *dlg = new QgsSymbolSelectorWidget( symbol, mStyle, mLayer, nullptr );
dlg->setContext( mContext );
connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolsFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsCategorizedSymbolRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

@@ -202,7 +202,7 @@ void QgsPointClusterRendererWidget::on_mCenterSymbolPushButton_clicked()
dlg->setContext( context );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateCenterSymbolFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsPointClusterRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

@@ -376,7 +376,7 @@ void QgsPointDisplacementRendererWidget::on_mCenterSymbolPushButton_clicked()
dlg->setContext( context );

connect( dlg, SIGNAL( widgetChanged() ), this, SLOT( updateCenterSymbolFromWidget() ) );
connect( dlg, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget * ) ) );
connect( dlg, &QgsPanelWidget::panelAccepted, this, &QgsPointDisplacementRendererWidget::cleanUpSymbolSelector );
openPanel( dlg );
}

@@ -134,7 +134,7 @@ QgsRendererPropertiesDialog::QgsRendererPropertiesDialog( QgsVectorLayer *layer,
<< mEffectWidget;

connectValueChanged( widgets, SIGNAL( widgetChanged() ) );
connect( mEffectWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mEffectWidget, &QgsPanelWidget::showPanel, this, &QgsRendererPropertiesDialog::openPanel );
}

void QgsRendererPropertiesDialog::connectValueChanged( const QList<QWidget *> &widgets, const char *slot )
@@ -260,7 +260,7 @@ void QgsRendererPropertiesDialog::rendererChanged()
connect( mActiveWidget, SIGNAL( layerVariablesChanged() ), this, SIGNAL( layerVariablesChanged() ) );
}
connect( mActiveWidget, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( mActiveWidget, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mActiveWidget, &QgsPanelWidget::showPanel, this, &QgsRendererPropertiesDialog::openPanel );
w->setDockMode( mDockMode );
}
else
@@ -183,7 +183,7 @@ void QgsRuleBasedRendererWidget::editRule( const QModelIndex &index )

QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );
widget->setPanelTitle( tr( "Edit rule" ) );
connect( widget, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget * ) ) );
connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
openPanel( widget );
}
@@ -260,7 +260,7 @@ void QgsRuleBasedRendererWidget::refineRuleCategoriesGui()
{
QgsCategorizedSymbolRendererWidget *w = new QgsCategorizedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add categories to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( refineRuleCategoriesAccepted( QgsPanelWidget * ) ) );
connect( w, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::refineRuleCategoriesAccepted );
w->setContext( mContext );
openPanel( w );
}
@@ -269,7 +269,7 @@ void QgsRuleBasedRendererWidget::refineRuleRangesGui()
{
QgsGraduatedSymbolRendererWidget *w = new QgsGraduatedSymbolRendererWidget( mLayer, mStyle, nullptr );
w->setPanelTitle( tr( "Add ranges to rules" ) );
connect( w, SIGNAL( panelAccepted( QgsPanelWidget * ) ), this, SLOT( refineRuleRangesAccepted( QgsPanelWidget * ) ) );
connect( w, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::refineRuleRangesAccepted );
w->setContext( mContext );
openPanel( w );
}
@@ -642,7 +642,7 @@ QgsRendererRulePropsWidget::QgsRendererRulePropsWidget( QgsRuleBasedRenderer::Ru
mSymbolSelector = new QgsSymbolSelectorWidget( mSymbol, style, mLayer, this );
mSymbolSelector->setContext( mContext );
connect( mSymbolSelector, SIGNAL( widgetChanged() ), this, SIGNAL( widgetChanged() ) );
connect( mSymbolSelector, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mSymbolSelector, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );

QVBoxLayout *l = new QVBoxLayout;
l->addWidget( mSymbolSelector );
@@ -53,7 +53,7 @@ QgsSingleSymbolRendererWidget::QgsSingleSymbolRendererWidget( QgsVectorLayer *la
// setup ui
mSelector = new QgsSymbolSelectorWidget( mSingleSymbol, mStyle, mLayer, nullptr );
connect( mSelector, SIGNAL( symbolModified() ), this, SLOT( changeSingleSymbol() ) );
connect( mSelector, SIGNAL( showPanel( QgsPanelWidget * ) ), this, SLOT( openPanel( QgsPanelWidget * ) ) );
connect( mSelector, &QgsPanelWidget::showPanel, this, &QgsPanelWidget::openPanel );

QVBoxLayout *layout = new QVBoxLayout( this );
layout->setContentsMargins( 0, 0, 0, 0 );

0 comments on commit 7aff3e7

Please sign in to comment.