void SAQwtSymbolSetWidget::onBrushColorChanged(const QColor &clr) { QBrush symbolBrush = m_symbol.brush(); symbolBrush.setColor(clr); m_symbol.setBrush(symbolBrush); updateSymbol(); emit symbolSetChanged(m_symbol); }
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); }
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(); }
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); }
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; }
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; }
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); }
void SAQwtSymbolSetWidget::onSymbolSelectChanged(QwtSymbol::Style style) { m_symbol.setStyle(style); updateSymbol(); emit symbolSetChanged(m_symbol); }
void SAQwtSymbolSetWidget::onEdgePenChanged(const QPen &pen) { m_symbol.setPen(pen); updateSymbol(); emit symbolSetChanged(m_symbol); }