39 #include <QMessageBox> 40 #include <QStandardItemModel> 41 #include <QStandardItem> 49 QgsGraduatedSymbolRendererModel::QgsGraduatedSymbolRendererModel( QObject *parent ) : QAbstractItemModel( parent )
50 , mMimeFormat( QStringLiteral(
"application/x-qgsgraduatedsymbolrendererv2model" ) )
58 if ( mRenderer->
ranges().size() )
60 beginRemoveRows( QModelIndex(), 0, mRenderer->
ranges().size() - 1 );
71 if ( renderer->
ranges().size() )
73 beginInsertRows( QModelIndex(), 0, renderer->
ranges().size() - 1 );
84 void QgsGraduatedSymbolRendererModel::addClass(
QgsSymbol *symbol )
86 if ( !mRenderer )
return;
87 int idx = mRenderer->
ranges().size();
88 beginInsertRows( QModelIndex(), idx, idx );
93 void QgsGraduatedSymbolRendererModel::addClass(
const QgsRendererRange &range )
99 int idx = mRenderer->
ranges().size();
100 beginInsertRows( QModelIndex(), idx, idx );
105 QgsRendererRange QgsGraduatedSymbolRendererModel::rendererRange(
const QModelIndex &index )
107 if ( !index.isValid() || !mRenderer || mRenderer->
ranges().size() <= index.row() )
112 return mRenderer->
ranges().value( index.row() );
115 Qt::ItemFlags QgsGraduatedSymbolRendererModel::flags(
const QModelIndex &index )
const 117 if ( !index.isValid() )
119 return Qt::ItemIsDropEnabled;
122 Qt::ItemFlags flags = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsUserCheckable;
124 if ( index.column() == 2 )
126 flags |= Qt::ItemIsEditable;
132 Qt::DropActions QgsGraduatedSymbolRendererModel::supportedDropActions()
const 134 return Qt::MoveAction;
137 QVariant QgsGraduatedSymbolRendererModel::data(
const QModelIndex &index,
int role )
const 139 if ( !index.isValid() || !mRenderer )
return QVariant();
143 if ( role == Qt::CheckStateRole && index.column() == 0 )
145 return range.
renderState() ? Qt::Checked : Qt::Unchecked;
147 else if ( role == Qt::DisplayRole || role == Qt::ToolTipRole )
149 switch ( index.column() )
154 if ( decimalPlaces < 0 ) decimalPlaces = 0;
155 return QString::number( range.
lowerValue(),
'f', decimalPlaces ) +
" - " + QString::number( range.
upperValue(),
'f', decimalPlaces );
158 return range.
label();
163 else if ( role == Qt::DecorationRole && index.column() == 0 && range.
symbol() )
167 else if ( role == Qt::TextAlignmentRole )
169 return ( index.column() == 0 ) ? Qt::AlignHCenter : Qt::AlignLeft;
171 else if ( role == Qt::EditRole )
173 switch ( index.column() )
177 return range.
label();
186 bool QgsGraduatedSymbolRendererModel::setData(
const QModelIndex &index,
const QVariant &value,
int role )
188 if ( !index.isValid() )
191 if ( index.column() == 0 && role == Qt::CheckStateRole )
194 emit dataChanged( index, index );
198 if ( role != Qt::EditRole )
201 switch ( index.column() )
212 emit dataChanged( index, index );
216 QVariant QgsGraduatedSymbolRendererModel::headerData(
int section, Qt::Orientation orientation,
int role )
const 218 if ( orientation == Qt::Horizontal && role == Qt::DisplayRole && section >= 0 && section < 3 )
221 lst << tr(
"Symbol" ) << tr(
"Values" ) << tr(
"Legend" );
222 return lst.value( section );
227 int QgsGraduatedSymbolRendererModel::rowCount(
const QModelIndex &parent )
const 229 if ( parent.isValid() || !mRenderer )
233 return mRenderer->
ranges().size();
236 int QgsGraduatedSymbolRendererModel::columnCount(
const QModelIndex &index )
const 242 QModelIndex QgsGraduatedSymbolRendererModel::index(
int row,
int column,
const QModelIndex &parent )
const 244 if ( hasIndex( row, column, parent ) )
246 return createIndex( row, column );
248 return QModelIndex();
251 QModelIndex QgsGraduatedSymbolRendererModel::parent(
const QModelIndex &index )
const 254 return QModelIndex();
257 QStringList QgsGraduatedSymbolRendererModel::mimeTypes()
const 260 types << mMimeFormat;
264 QMimeData *QgsGraduatedSymbolRendererModel::mimeData(
const QModelIndexList &indexes )
const 266 QMimeData *mimeData =
new QMimeData();
267 QByteArray encodedData;
269 QDataStream stream( &encodedData, QIODevice::WriteOnly );
272 Q_FOREACH (
const QModelIndex &index, indexes )
274 if ( !index.isValid() || index.column() != 0 )
277 stream << index.row();
279 mimeData->setData( mMimeFormat, encodedData );
283 bool QgsGraduatedSymbolRendererModel::dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
287 if ( action != Qt::MoveAction )
return true;
289 if ( !data->hasFormat( mMimeFormat ) )
return false;
291 QByteArray encodedData = data->data( mMimeFormat );
292 QDataStream stream( &encodedData, QIODevice::ReadOnly );
295 while ( !stream.atEnd() )
302 int to = parent.row();
305 if ( to == -1 ) to = mRenderer->
ranges().size();
306 for (
int i = rows.size() - 1; i >= 0; i-- )
308 QgsDebugMsg( QString(
"move %1 to %2" ).arg( rows[i] ).arg( to ) );
311 if ( rows[i] < t ) t--;
314 for (
int j = 0; j < i; j++ )
316 if ( to < rows[j] && rows[i] > rows[j] ) rows[j] += 1;
319 if ( rows[i] < to ) to--;
321 emit dataChanged( createIndex( 0, 0 ), createIndex( mRenderer->
ranges().size(), 0 ) );
326 void QgsGraduatedSymbolRendererModel::deleteRows( QList<int> rows )
328 for (
int i = rows.size() - 1; i >= 0; i-- )
330 beginRemoveRows( QModelIndex(), rows[i], rows[i] );
336 void QgsGraduatedSymbolRendererModel::removeAllRows()
338 beginRemoveRows( QModelIndex(), 0, mRenderer->
ranges().size() - 1 );
343 void QgsGraduatedSymbolRendererModel::sort(
int column, Qt::SortOrder order )
353 else if ( column == 2 )
358 emit dataChanged( createIndex( 0, 0 ), createIndex( mRenderer->
ranges().size(), 0 ) );
362 void QgsGraduatedSymbolRendererModel::updateSymbology(
bool resetModel )
370 emit dataChanged( createIndex( 0, 0 ), createIndex( mRenderer->
ranges().size(), 0 ) );
374 void QgsGraduatedSymbolRendererModel::updateLabels()
376 emit dataChanged( createIndex( 0, 2 ), createIndex( mRenderer->
ranges().size(), 2 ) );
380 QgsGraduatedSymbolRendererViewStyle::QgsGraduatedSymbolRendererViewStyle( QStyle *style )
381 : QProxyStyle( style )
384 void QgsGraduatedSymbolRendererViewStyle::drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget )
const 386 if ( element == QStyle::PE_IndicatorItemViewItemDrop && !option->rect.isNull() )
388 QStyleOption opt( *option );
389 opt.rect.setLeft( 0 );
391 opt.rect.setHeight( 0 );
392 if ( widget ) opt.rect.setRight( widget->width() );
393 QProxyStyle::drawPrimitive( element, &opt, painter, widget );
396 QProxyStyle::drawPrimitive( element, option, painter, widget );
415 if ( mContext.mapCanvas() )
456 connect( methodComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsGraduatedSymbolRendererWidget::methodComboBox_currentIndexChanged );
457 this->layout()->setContentsMargins( 0, 0, 0, 0 );
459 mModel =
new QgsGraduatedSymbolRendererModel(
this );
462 mExpressionWidget->setLayer(
mLayer );
470 btnColorRamp->setShowRandomColorRamp(
true );
473 QString defaultColorRamp =
QgsProject::instance()->
readEntry( QStringLiteral(
"DefaultStyles" ), QStringLiteral(
"/ColorRamp" ), QLatin1String(
"" ) );
474 if ( !defaultColorRamp.isEmpty() )
476 btnColorRamp->setColorRampFromName( defaultColorRamp );
481 btnColorRamp->setColorRamp( ramp );
486 viewGraduated->setStyle(
new QgsGraduatedSymbolRendererViewStyle( viewGraduated->style() ) );
490 methodComboBox->blockSignals(
true );
491 methodComboBox->addItem( QStringLiteral(
"Color" ) );
494 methodComboBox->addItem( QStringLiteral(
"Size" ) );
495 minSizeSpinBox->setValue( 1 );
496 maxSizeSpinBox->setValue( 8 );
500 methodComboBox->addItem( QStringLiteral(
"Size" ) );
501 minSizeSpinBox->setValue( .1 );
502 maxSizeSpinBox->setValue( 2 );
504 methodComboBox->blockSignals(
false );
526 QMenu *advMenu =
new QMenu(
this );
528 advMenu->addAction( tr(
"Symbol levels…" ),
this, SLOT(
showSymbolLevels() ) );
531 QAction *actionDdsLegend = advMenu->addAction( tr(
"Data-defined size legend…" ) );
533 connect( actionDdsLegend, &QAction::triggered,
this, &QgsGraduatedSymbolRendererWidget::dataDefinedSizeLegend );
536 btnAdvanced->setMenu( advMenu );
538 mHistogramWidget->setLayer(
mLayer );
539 mHistogramWidget->setRenderer( mRenderer );
543 mExpressionWidget->registerExpressionContextGenerator(
this );
546 void QgsGraduatedSymbolRendererWidget::mSizeUnitWidget_changed()
548 if ( !mGraduatedSymbol )
return;
550 mGraduatedSymbol->
setMapUnitScale( mSizeUnitWidget->getMapUnitScale() );
560 delete mGraduatedSymbol;
609 if ( mRenderer->
mode() < cboGraduatedMode->count() )
610 cboGraduatedMode->setCurrentIndex( mRenderer->
mode() );
613 int nclasses = mRenderer->
ranges().count();
614 if ( nclasses && updateCount )
615 spinGraduatedClasses->setValue( mRenderer->
ranges().count() );
619 mExpressionWidget->setField( attrName );
620 mHistogramWidget->setSourceFieldExp( attrName );
625 delete mGraduatedSymbol;
630 mModel->setRenderer( mRenderer );
631 viewGraduated->setModel( mModel );
633 if ( mGraduatedSymbol )
635 mSizeUnitWidget->blockSignals(
true );
636 mSizeUnitWidget->setUnit( mGraduatedSymbol->
outputUnit() );
637 mSizeUnitWidget->setMapUnitScale( mGraduatedSymbol->
mapUnitScale() );
638 mSizeUnitWidget->blockSignals(
false );
642 methodComboBox->blockSignals(
true );
645 methodComboBox->setCurrentIndex( 0 );
653 methodComboBox->setCurrentIndex( 1 );
654 if ( !mRenderer->
ranges().isEmpty() )
660 toggleMethodWidgets( methodComboBox->currentIndex() );
661 methodComboBox->blockSignals(
false );
664 txtLegendFormat->setText( labelFormat.
format() );
665 spinPrecision->setValue( labelFormat.
precision() );
668 viewGraduated->resizeColumnToContents( 0 );
669 viewGraduated->resizeColumnToContents( 1 );
670 viewGraduated->resizeColumnToContents( 2 );
672 mHistogramWidget->refresh();
683 void QgsGraduatedSymbolRendererWidget::methodComboBox_currentIndexChanged(
int idx )
685 toggleMethodWidgets( idx );
693 QMessageBox::critical(
this, tr(
"Select Method" ), tr(
"No color ramp defined." ) );
701 lblColorRamp->setVisible(
false );
702 btnColorRamp->setVisible(
false );
703 lblSize->setVisible(
true );
704 minSizeSpinBox->setVisible(
true );
705 lblSize->setVisible(
true );
706 maxSizeSpinBox->setVisible(
true );
707 mSizeUnitWidget->setVisible(
true );
714 void QgsGraduatedSymbolRendererWidget::toggleMethodWidgets(
int idx )
718 lblColorRamp->setVisible(
true );
719 btnColorRamp->setVisible(
true );
720 lblSize->setVisible(
false );
721 minSizeSpinBox->setVisible(
false );
722 lblSizeTo->setVisible(
false );
723 maxSizeSpinBox->setVisible(
false );
724 mSizeUnitWidget->setVisible(
false );
728 lblColorRamp->setVisible(
false );
729 btnColorRamp->setVisible(
false );
730 lblSize->setVisible(
true );
731 minSizeSpinBox->setVisible(
true );
732 lblSizeTo->setVisible(
true );
733 maxSizeSpinBox->setVisible(
true );
734 mSizeUnitWidget->setVisible(
true );
743 mModel->updateSymbology( reset );
747 void QgsGraduatedSymbolRendererWidget::cleanUpSymbolSelector(
QgsPanelWidget *container )
756 void QgsGraduatedSymbolRendererWidget::updateSymbolsFromWidget()
759 delete mGraduatedSymbol;
762 mSizeUnitWidget->blockSignals(
true );
763 mSizeUnitWidget->setUnit( mGraduatedSymbol->outputUnit() );
765 mSizeUnitWidget->blockSignals(
false );
767 QItemSelectionModel *m = viewGraduated->selectionModel();
768 QModelIndexList selectedIndexes = m->selectedRows( 1 );
769 if ( m && !selectedIndexes.isEmpty() )
771 Q_FOREACH (
const QModelIndex &idx, selectedIndexes )
775 int rangeIdx = idx.row();
777 if ( selectedIndexes.count() > 1 )
780 newRangeSymbol->
setColor( mRenderer->
ranges().at( rangeIdx ).symbol()->color() );
799 QString attrName = mExpressionWidget->currentField();
801 int nclasses = spinGraduatedClasses->value();
803 std::unique_ptr<QgsColorRamp> ramp( btnColorRamp->colorRamp() );
806 QMessageBox::critical(
this, tr(
"Apply Classification" ), tr(
"No color ramp defined." ) );
811 if ( cboGraduatedMode->currentIndex() == 0 )
813 else if ( cboGraduatedMode->currentIndex() == 2 )
815 else if ( cboGraduatedMode->currentIndex() == 3 )
817 else if ( cboGraduatedMode->currentIndex() == 4 )
826 if ( QMessageBox::Cancel == QMessageBox::question(
this, tr(
"Apply Classification" ), tr(
"Natural break classification (Jenks) is O(n2) complexity, your classification may take a long time.\nPress cancel to abort breaks calculation or OK to continue." ), QMessageBox::Cancel, QMessageBox::Ok ) )
835 if ( methodComboBox->currentIndex() == 0 )
839 QMessageBox::critical(
this, tr(
"Apply Classification" ), tr(
"No color ramp defined." ) );
849 QApplication::setOverrideCursor( Qt::WaitCursor );
852 if ( methodComboBox->currentIndex() == 1 )
853 mRenderer->
setSymbolSizes( minSizeSpinBox->value(), maxSizeSpinBox->value() );
856 QApplication::restoreOverrideCursor();
864 std::unique_ptr< QgsColorRamp > ramp( btnColorRamp->colorRamp() );
875 mRenderer->
setSymbolSizes( minSizeSpinBox->value(), maxSizeSpinBox->value() );
893 if ( !mGraduatedSymbol )
897 btnChangeGraduatedSymbol->setIcon( icon );
901 int QgsRendererPropertiesDialog::currentRangeRow()
903 QModelIndex idx = viewGraduated->selectionModel()->currentIndex();
904 if ( !idx.isValid() )
913 QModelIndexList selectedRows = viewGraduated->selectionModel()->selectedRows();
915 Q_FOREACH (
const QModelIndex &r, selectedRows )
919 rows.append( r.row() );
928 QModelIndexList selectedRows = viewGraduated->selectionModel()->selectedRows();
929 QModelIndexList::const_iterator sIt = selectedRows.constBegin();
931 for ( ; sIt != selectedRows.constEnd(); ++sIt )
933 selectedRanges.append( mModel->rendererRange( *sIt ) );
940 if ( idx.isValid() && idx.column() == 0 )
942 if ( idx.isValid() && idx.column() == 1 )
948 if ( !idx.isValid() )
951 mRowSelected = idx.row();
960 QgsSymbol *newSymbol = mRenderer->
ranges()[rangeIdx].symbol()->clone();
977 if ( decimalPlaces < 0 ) decimalPlaces = 0;
981 if ( dialog.exec() == QDialog::Accepted )
983 double lowerValue = dialog.
lowerValue().toDouble();
984 double upperValue = dialog.
upperValue().toDouble();
989 if ( cbxLinkBoundaries->isChecked() )
996 if ( rangeIdx < mRenderer->ranges().size() - 1 )
1002 mHistogramWidget->refresh();
1008 mModel->addClass( mGraduatedSymbol );
1009 mHistogramWidget->refresh();
1015 mModel->deleteRows( classIndexes );
1016 mHistogramWidget->refresh();
1021 mModel->removeAllRows();
1022 mHistogramWidget->refresh();
1028 bool ordered =
true;
1029 for (
int i = 1; i < ranges.size(); ++i )
1031 if ( ranges[i] < ranges[i - 1] )
1048 int result = QMessageBox::warning(
1050 tr(
"Link Class Boundaries" ),
1051 tr(
"Rows will be reordered before linking boundaries. Continue?" ),
1052 QMessageBox::Ok | QMessageBox::Cancel );
1053 if ( result != QMessageBox::Ok )
1055 cbxLinkBoundaries->setChecked(
false );
1062 for (
int i = 1; i < mRenderer->
ranges().size(); ++i )
1072 if ( item->column() == 2 )
1074 QString label = item->text();
1075 int idx = item->row();
1083 txtLegendFormat->text(),
1084 spinPrecision->value(),
1085 cbxTrimTrailingZeroes->isChecked() );
1087 mModel->updateLabels();
1095 QItemSelectionModel *m = viewGraduated->selectionModel();
1096 QModelIndexList selectedIndexes = m->selectedRows( 1 );
1097 if ( m && !selectedIndexes.isEmpty() )
1100 QModelIndexList::const_iterator indexIt = selectedIndexes.constBegin();
1101 for ( ; indexIt != selectedIndexes.constEnd(); ++indexIt )
1103 QStringList list = m->model()->data( *indexIt ).toString().split(
' ' );
1104 if ( list.size() < 3 )
1109 double lowerBound = list.at( 0 ).toDouble();
1110 double upperBound = list.at( 2 ).toDouble();
1114 selectedSymbols.append( s );
1124 if ( decimalPlaces < 0 )
1126 double precision = 1.0 / std::pow( 10, decimalPlaces );
1128 for ( QgsRangeList::const_iterator it = ranges.begin(); it != ranges.end(); ++it )
1132 return it->symbol();
1142 mModel->updateSymbology();
1144 mHistogramWidget->refresh();
1155 viewGraduated->selectionModel()->clear();
1158 cbxLinkBoundaries->setChecked(
false );
1175 if ( event->key() == Qt::Key_C &&
event->modifiers() == Qt::ControlModifier )
1177 mCopyBuffer.clear();
1180 else if ( event->key() == Qt::Key_V &&
event->modifiers() == Qt::ControlModifier )
1182 QgsRangeList::const_iterator rIt = mCopyBuffer.constBegin();
1183 for ( ; rIt != mCopyBuffer.constEnd(); ++rIt )
1185 mModel->addClass( *rIt );
1191 void QgsGraduatedSymbolRendererWidget::dataDefinedSizeLegend()
const QgsRendererRangeLabelFormat & labelFormat() const
Return the label format used to generate default classification labels.
static QgsGraduatedSymbolRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
creates a QgsGraduatedSymbolRenderer from an existing renderer.
void setMapUnitScale(const QgsMapUnitScale &scale)
QString readEntry(const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
bool updateRangeUpperValue(int rangeIndex, double value)
QList< QgsRendererRange > QgsRangeList
QgsMapUnitScale mapUnitScale() const
QString classAttribute() const
Abstract base class for color ramps.
void setGraduatedMethod(GraduatedMethod method)
set the method used for graduation (either size or color)
QgsWkbTypes::GeometryType geometryType() const
Returns point, line or polygon.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
void setSymbolSizes(double minSize, double maxSize)
set varying symbol size for classes
void setLowerValue(const QString &val)
void addClass(QgsSymbol *symbol)
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
The QgsMapSettings class contains configuration for rendering of the map.
QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol.
void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol.
void sortByValue(Qt::SortOrder order=Qt::AscendingOrder)
double lowerValue() const
bool updateRangeSymbol(int rangeIndex, QgsSymbol *symbol)
static QgsSymbol * defaultSymbol(QgsWkbTypes::GeometryType geomType)
return new default symbol for specified geometry type
void updateColorRamp(QgsColorRamp *ramp=nullptr)
Update the color ramp used.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
static QIcon symbolPreviewIcon(QgsSymbol *symbol, QSize size, int padding=0)
Returns an icon preview for a color ramp.
bool updateRangeLowerValue(int rangeIndex, double value)
long featureCount(const QString &legendKey) const
Number of features rendered with specified legend key.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
points (e.g., for font sizes)
QgsColorRamp * sourceColorRamp()
Returns the source color ramp, from which each classes' color is derived.
QgsSymbol * symbol() const
Single scope for storing variables and functions for use within a QgsExpressionContext.
QgsDataDefinedSizeLegend * dataDefinedSizeLegend() const
Returns configuration of appearance of legend when using data-defined size for marker symbols...
void moveClass(int from, int to)
Moves the category at index position from to index position to.
void calculateLabelPrecision(bool updateRanges=true)
Reset the label decimal places to a numberbased on the minimum class interval.
void updateClasses(QgsVectorLayer *vlayer, Mode mode, int nclasses)
Recalculate classes for a layer.
double minSymbolSize() const
return the min symbol size when graduated by size
static QgsExpressionContextScope * atlasScope(QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object...
void sortByLabel(Qt::SortOrder order=Qt::AscendingOrder)
GraduatedMethod graduatedMethod() const
return the method used for graduation (either size or color)
double maxSymbolSize() const
return the max symbol size when graduated by size
virtual QgsSymbol * clone() const =0
Get a deep copy of this symbol.
void setDataDefinedSizeLegend(QgsDataDefinedSizeLegend *settings)
Configures appearance of legend when renderer is configured to use data-defined size for marker symbo...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
static QgsProject * instance()
Returns the QgsProject singleton instance.
void setUpperValue(const QString &val)
double upperValue() const
bool updateRangeRenderState(int rangeIndex, bool render)
QString lowerValue() const
bool updateRangeLabel(int rangeIndex, const QString &label)
QString upperValue() const
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
void setClassAttribute(const QString &attr)
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
Represents a vector layer which manages a vector based data sets.
const QgsRangeList & ranges() const
void setSourceColorRamp(QgsColorRamp *ramp)
Sets the source color ramp.
void updateSymbols(QgsSymbol *sym)
Update all the symbols but leave breaks and colors.
QgsSymbol * sourceSymbol()
Returns the renderer's source symbol, which is the base symbol used for the each classes' symbol befo...
void deleteClass(int idx)
void setLabelFormat(const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges=false)
Set the label format used to generate default classification labels.
void setColor(const QColor &color)