Example #1
0
void SAQwtSymbolSetWidget::onBrushColorChanged(const QColor &clr)
{
    QBrush symbolBrush = m_symbol.brush();
    symbolBrush.setColor(clr);
    m_symbol.setBrush(symbolBrush);
    updateSymbol();
    emit symbolSetChanged(m_symbol);
}
Example #2
0
void SAQwtSymbolSetWidget::onBrushAlphaSliderValueChanged(int v)
{
    QBrush symbolBrush = m_symbol.brush();
    QColor clr = symbolBrush.color();
    clr.setAlpha(v);
    symbolBrush.setColor(clr);
    m_symbol.setBrush(symbolBrush);
    updateSymbol();
    emit symbolSetChanged(m_symbol);
}
Example #3
0
void SAQwtSymbolSetWidget::setSymbol(const QwtSymbol *symbol)
{
    m_symbol.setStyle(symbol->style());
    m_symbol.setPen(symbol->pen());
    m_symbol.setBrush(symbol->brush());
    m_symbol.setSize(symbol->size());
    ui->comboBoxSymbolStyle->setStyle(symbol->style());
    ui->spinBoxSizeX->setValue(symbol->size().width());
    ui->spinBoxSizeY->setValue(symbol->size().height());
    ui->edgetPenSet->setPen(symbol->pen());
    ui->colorPushButtonBrush->setCurrentColor(symbol->brush().color());
    ui->horizontalSliderBrushAlpha->setValue(symbol->brush().color().alpha());

    updateSymbol();
}
Example #4
0
void SAQwtSymbolSetWidget::init()
{
    ui->colorPushButtonBrush->setStandardColors();
    updateSymbol();

    connect(ui->comboBoxSymbolStyle,&SAQwtSymbolComboBox::symbolSelectChanged
            ,this,&SAQwtSymbolSetWidget::onSymbolSelectChanged);
    connect(ui->spinBoxSizeX,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged)
            ,this,&SAQwtSymbolSetWidget::onSpinBoxSizeXValueChanged);
    connect(ui->spinBoxSizeY,static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged)
            ,this,&SAQwtSymbolSetWidget::onSpinBoxSizeYValueChanged);
    connect(ui->colorPushButtonBrush,&SAColorPickerButton::colorChanged
            ,this,&SAQwtSymbolSetWidget::onBrushColorChanged);
    connect(ui->edgetPenSet,&SAPenSetWidget::penChanged
            ,this,&SAQwtSymbolSetWidget::onEdgePenChanged);
    connect(ui->horizontalSliderBrushAlpha,&QSlider::valueChanged
            ,this,&SAQwtSymbolSetWidget::onBrushAlphaSliderValueChanged);
}
Example #5
0
bool QgsStyleV2::addSymbol( QString name, QgsSymbolV2* symbol, bool update )
{
  if ( !symbol || name.isEmpty() )
    return false;

  // delete previous symbol (if any)
  if ( mSymbols.contains( name ) )
  {
    // TODO remove groups and tags?
    delete mSymbols.value( name );
    mSymbols.insert( name, symbol );
    if ( update )
      updateSymbol( SymbolEntity, name );
  }
  else
  {
    mSymbols.insert( name, symbol );
    if ( update )
      saveSymbol( name, symbol, 0, QStringList() );
  }

  return true;
}
Example #6
0
bool QgsStyleV2::addColorRamp( QString name, QgsVectorColorRampV2* colorRamp, bool update )
{
  if ( !colorRamp || name.isEmpty() )
    return false;

  // delete previous color ramps (if any)
  if ( mColorRamps.contains( name ) )
  {
    // TODO remove groups and tags?
    delete mColorRamps.value( name );
    mColorRamps.insert( name, colorRamp );
    if ( update )
      updateSymbol( ColorrampEntity, name );
  }
  else
  {
    mColorRamps.insert( name, colorRamp );
    if ( update )
      saveColorRamp( name, colorRamp, 0, QStringList() );
  }

  return true;
}
Example #7
0
void SAQwtSymbolSetWidget::onSpinBoxSizeXValueChanged(int v)
{
    if(m_signalLock)
    {
        return;
    }
    QSize symbolSize;
    if(ui->toolButtonFixWidthHeight->isChecked())
    {
        symbolSize.setWidth(v);
        symbolSize.setHeight(v);
        m_signalLock = true;
        ui->spinBoxSizeY->setValue(v);
        m_signalLock = false;
    }
    else
    {
        symbolSize.setWidth(ui->spinBoxSizeX->value());
        symbolSize.setHeight(ui->spinBoxSizeY->value());
    }
    m_symbol.setSize(symbolSize);
    updateSymbol();
    emit symbolSetChanged(m_symbol);
}
Example #8
0
void SAQwtSymbolSetWidget::onSymbolSelectChanged(QwtSymbol::Style style)
{
    m_symbol.setStyle(style);
    updateSymbol();
    emit symbolSetChanged(m_symbol);
}
Example #9
0
void SAQwtSymbolSetWidget::onEdgePenChanged(const QPen &pen)
{
    m_symbol.setPen(pen);
    updateSymbol();
    emit symbolSetChanged(m_symbol);
}