当前位置: 首页>>代码示例>>C++>>正文


C++ QgsSymbolSelectorWidget类代码示例

本文整理汇总了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" ) );
}
开发者ID:GeoCat,项目名称:QGIS,代码行数:23,代码来源:qgscomposermapgridwidget.cpp

示例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" ) );
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:23,代码来源:qgscomposershapewidget.cpp

示例3: sender

void QgsComposerArrowWidget::updateLineStyleFromWidget()
{
  QgsSymbolSelectorWidget *w = qobject_cast<QgsSymbolSelectorWidget *>( sender() );
  mArrow->setLineSymbol( dynamic_cast< QgsLineSymbol * >( w->symbol()->clone() ) );
  mArrow->update();
}
开发者ID:cz172638,项目名称:QGIS,代码行数:6,代码来源:qgscomposerarrowwidget.cpp

示例4: sender

void QgsComposerPolygonWidget::updateStyleFromWidget()
{
  QgsSymbolSelectorWidget* w = qobject_cast<QgsSymbolSelectorWidget*>( sender() );
  mComposerPolygon->setPolygonStyleSymbol( dynamic_cast< QgsFillSymbol* >( w->symbol() ) );
  mComposerPolygon->update();
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:6,代码来源:qgscomposerpolygonwidget.cpp

示例5: sender

void QgsComposerShapeWidget::updateSymbolFromWidget()
{
  QgsSymbolSelectorWidget* w = qobject_cast<QgsSymbolSelectorWidget*>( sender() );
  mComposerShape->setShapeStyleSymbol( dynamic_cast< QgsFillSymbol* >( w->symbol() ) );
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:5,代码来源:qgscomposershapewidget.cpp


注:本文中的QgsSymbolSelectorWidget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。