20 #include <QAbstractButton> 41 QSize iconSize( 50, 16 );
42 cboSchemeName->setIconSize( iconSize );
45 Q_FOREACH (
const QString& schemeName, schemes )
51 cboSchemeName->addItem( icon, schemeName );
54 cboSchemeName->setCurrentIndex( cboSchemeName->findText( ramp->
schemeName() ) );
59 connect( cboColors, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
setColors() ) );
66 QString oldVariant = cboColors->currentText();
69 QString schemeName = cboSchemeName->currentText();
71 Q_FOREACH (
int variant, variants )
77 int idx = cboColors->findText( oldVariant );
81 idx = cboColors->count() - 1;
83 cboColors->setCurrentIndex( idx );
103 int num = cboColors->currentText().toInt();
QgsVectorColorBrewerColorRampV2Dialog(QgsVectorColorBrewerColorRampV2 *ramp, QWidget *parent=nullptr)
static QIcon colorRampPreviewIcon(QgsVectorColorRampV2 *ramp, QSize size)
static QPixmap colorRampPreviewPixmap(QgsVectorColorRampV2 *ramp, QSize size)
QgsVectorColorBrewerColorRampV2 * mRamp
void setColors(int colors)
QString number(int n, int base)
static QStringList listSchemeNames()
QString schemeName() const
void setSchemeName(const QString &schemeName)
static QList< int > listSchemeVariants(const QString &schemeName)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)