22 #include <QTableWidgetItem> 23 #include <QItemDelegate> 33 , mForceOrderingEnabled( false )
40 tableLevels->setItemDelegate(
new SpinBoxDelegate(
this ) );
42 chkEnable->setChecked( usingSymbolLevels );
64 if ( layers > maxLayers )
68 tableLevels->setColumnCount( maxLayers + 1 );
70 for (
int i = 0; i < maxLayers; i++ )
80 if ( !usingSymbolLevels )
96 for (
int row = 0; row <
mList.
count(); row++ )
101 itemLabel->
setFlags( itemLabel->
flags() ^ Qt::ItemIsEditable );
102 tableLevels->setItem( row, 0, itemLabel );
103 for (
int layer = 0; layer <
mMaxLayers; layer++ )
117 tableLevels->setItem( row, layer + 1, item );
118 tableLevels->resizeColumnToContents( 0 );
126 tableLevels->setEnabled( chkEnable->isChecked() );
143 return chkEnable->isChecked();
161 chkEnable->setChecked(
true );
190 int value = spinBox->
value();
192 model->
setData( index, value, Qt::EditRole );
void renderingPassChanged(int row, int column)
QByteArray toByteArray() const
int mMaxLayers
maximal number of layers from all symbols
static QIcon symbolLayerPreviewIcon(QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
const T & at(int i) const
QgsSymbolLevelsV2Dialog(const QgsLegendSymbolList &list, bool usingSymbolLevels, QWidget *parent=nullptr)
QString tr(const char *sourceText, const char *disambiguation, int n)
void setValue(const QString &key, const QVariant &value)
int renderingPass() const
const char * name() const
The output shall be in millimeters.
QString number(int n, int base)
static QIcon symbolPreviewIcon(QgsSymbolV2 *symbol, QSize size)
int count(const T &value) const
int toInt(bool *ok) const
void setRenderingPass(int renderingPass)
~QgsSymbolLevelsV2Dialog()
int symbolLayerCount()
Returns total number of symbol layers contained in the symbol.
virtual QVariant data(const QModelIndex &index, int role) const=0
bool mForceOrderingEnabled
whether symbol layers always should be used (default false)
void setForceOrderingEnabled(bool enabled)
QVariant value(const QString &key, const QVariant &defaultValue) const
const QAbstractItemModel * model() const
QgsLegendSymbolList mList
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
QgsSymbolLayerV2 * symbolLayer(int layer)
Returns a specific symbol layers contained in the symbol.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const