本文整理汇总了C++中QgsSymbolSelectorWidget类的典型用法代码示例。如果您正苦于以下问题:C++ QgsSymbolSelectorWidget类的具体用法?C++ QgsSymbolSelectorWidget怎么用?C++ QgsSymbolSelectorWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QgsSymbolSelectorWidget类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: atlasCoverageLayer
void QgsComposerMapGridWidget::on_mGridMarkerStyleButton_clicked()
{
if ( !mComposerMapGrid || !mComposerMap )
{
return;
}
// use the atlas coverage layer, if any
QgsVectorLayer *coverageLayer = atlasCoverageLayer();
QgsMarkerSymbol *newSymbol = static_cast<QgsMarkerSymbol *>( mComposerMapGrid->markerSymbol()->clone() );
QgsExpressionContext context = mComposerMap->createExpressionContext();
QgsSymbolSelectorWidget *d = new QgsSymbolSelectorWidget( newSymbol, QgsStyle::defaultStyle(), coverageLayer, nullptr );
QgsSymbolWidgetContext symbolContext;
symbolContext.setExpressionContext( &context );
d->setContext( symbolContext );
connect( d, &QgsPanelWidget::widgetChanged, this, &QgsComposerMapGridWidget::updateGridMarkerStyleFromWidget );
connect( d, &QgsPanelWidget::panelAccepted, this, &QgsComposerMapGridWidget::cleanUpGridMarkerStyleSelector );
openPanel( d );
mComposerMap->beginCommand( tr( "Grid markers style changed" ) );
}
示例2: atlasCoverageLayer
void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
{
if ( !mComposerShape )
{
return;
}
// use the atlas coverage layer, if any
QgsVectorLayer* coverageLayer = atlasCoverageLayer();
QgsFillSymbol* newSymbol = mComposerShape->shapeStyleSymbol()->clone();
QgsExpressionContext context = mComposerShape->createExpressionContext();
QgsSymbolSelectorWidget* d = new QgsSymbolSelectorWidget( newSymbol, QgsStyle::defaultStyle(), coverageLayer, nullptr );
QgsSymbolWidgetContext symbolContext;
symbolContext.setExpressionContext( &context );
d->setContext( symbolContext );
connect( d, SIGNAL( widgetChanged() ), this, SLOT( updateSymbolFromWidget() ) );
connect( d, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( cleanUpSymbolSelector( QgsPanelWidget* ) ) );
openPanel( d );
mComposerShape->beginCommand( tr( "Shape style changed" ) );
}
示例3: sender
void QgsComposerArrowWidget::updateLineStyleFromWidget()
{
QgsSymbolSelectorWidget *w = qobject_cast<QgsSymbolSelectorWidget *>( sender() );
mArrow->setLineSymbol( dynamic_cast< QgsLineSymbol * >( w->symbol()->clone() ) );
mArrow->update();
}
示例4: sender
void QgsComposerPolygonWidget::updateStyleFromWidget()
{
QgsSymbolSelectorWidget* w = qobject_cast<QgsSymbolSelectorWidget*>( sender() );
mComposerPolygon->setPolygonStyleSymbol( dynamic_cast< QgsFillSymbol* >( w->symbol() ) );
mComposerPolygon->update();
}
示例5: sender
void QgsComposerShapeWidget::updateSymbolFromWidget()
{
QgsSymbolSelectorWidget* w = qobject_cast<QgsSymbolSelectorWidget*>( sender() );
mComposerShape->setShapeStyleSymbol( dynamic_cast< QgsFillSymbol* >( w->symbol() ) );
}