コード例 #1
0
void QgsRuleBasedRendererWidget::editRule( const QModelIndex &index )
{
  if ( !index.isValid() )
    return;

  QgsRuleBasedRenderer::Rule *rule = mModel->ruleForIndex( index );
  QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this );

  if ( panel && panel->dockMode() )
  {
    QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );//panel?
    widget->setPanelTitle( tr( "Edit Rule" ) );
    connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
    connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsRuleBasedRendererWidget::liveUpdateRuleFromPanel );
    openPanel( widget );
    return;
  }

  QgsRendererRulePropsDialog dlg( rule, mLayer, mStyle, this, mContext );
  if ( dlg.exec() )
  {
    mModel->updateRule( index.parent(), index.row() );
    mModel->clearFeatureCounts();
    emit widgetChanged();
  }
}
コード例 #2
0
void QgsRuleBasedRendererWidget::editRule( const QModelIndex &index )
{
  if ( !index.isValid() )
    return;

  QgsRuleBasedRenderer::Rule *rule = mModel->ruleForIndex( index );

  QgsRendererRulePropsWidget *widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mContext );
  widget->setPanelTitle( tr( "Edit rule" ) );
  connect( widget, &QgsPanelWidget::panelAccepted, this, &QgsRuleBasedRendererWidget::ruleWidgetPanelAccepted );
  connect( widget, &QgsPanelWidget::widgetChanged, this, &QgsRuleBasedRendererWidget::liveUpdateRuleFromPanel );
  openPanel( widget );
}
コード例 #3
0
void QgsRuleBasedRendererV2Widget::editRule( const QModelIndex& index )
{
  if ( !index.isValid() )
    return;

  QgsRuleBasedRendererV2::Rule* rule = mModel->ruleForIndex( index );

  QgsRendererRulePropsWidget* widget = new QgsRendererRulePropsWidget( rule, mLayer, mStyle, this, mMapCanvas );
  widget->setDockMode( true );
  widget->setPanelTitle( tr( "Edit rule" ) );
  connect( widget, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( ruleWidgetPanelAccepted( QgsPanelWidget* ) ) );
  connect( widget, SIGNAL( widgetChanged() ), this, SLOT( liveUpdateRuleFromPanel() ) );
  openPanel( widget );
}