25 QComboBox( parent ), mStyle( NULL ), mSourceColorRamp( NULL ), mShowGradientOnly( false )
48 if ( !mShowGradientOnly || ramp->
type() ==
"gradient" )
57 if ( !mShowGradientOnly )
67 if ( rampName ==
tr(
"Random colors" ) )
80 return index ==
count() - 1;
97 if ( index !=
count() - 1 )
102 if ( !mShowGradientOnly )
QgsVectorColorRampV2 * currentColorRamp()
return new instance of the current color ramp or NULL if there is no active color ramp ...
static QIcon colorRampPreviewIcon(QgsVectorColorRampV2 *ramp, QSize size)
virtual QString type() const =0
void setIconSize(const QSize &size)
QString itemText(int index) const
QStringList colorRampNames()
return a list of names of color ramps
QString tr(const char *sourceText, const char *disambiguation, int n)
void insertItem(int index, const QString &text, const QVariant &userData)
bool save(QString filename=QString())
save style into a file (will use current filename if empty string is passed)
void addItem(const QString &text, const QVariant &userData)
virtual QgsVectorColorRampV2 * clone() const =0
void activated(int index)
void colorRampChanged(int index)
bool blockSignals(bool block)
QgsColorRampComboBox(QWidget *parent=0)
void setSourceColorRamp(QgsVectorColorRampV2 *sourceRamp)
add/select color ramp which was used previously by the renderer
bool createNewColorRampSelected() const
Returns true if the current selection in the combo box is the option for creating a new color ramp...
QgsVectorColorRampV2 * mSourceColorRamp
void setItemIcon(int index, const QIcon &icon)
static QString addColorRampStatic(QWidget *parent, QgsStyleV2 *style, QString RampType=QString())
open add color ramp dialog, return color ramp's name if the ramp has been added
QgsVectorColorRampV2 * colorRamp(QString name)
return a NEW copy of color ramp
static QSize rampIconSize
QString currentText() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void populate(QgsStyleV2 *style)
initialize the combo box with color ramps from the style