45 QGridLayout *layout =
new QGridLayout(
this );
46 QLabel *label =
new QLabel( tr(
"The inverted polygon renderer only applies to polygon and multipolygon layers. \n" 47 "'%1' is not a polygon layer and then cannot be displayed" )
48 .arg( layer->
name() ),
this );
49 this->setLayout( layout );
50 layout->addWidget( label );
54 connect( mRendererComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsInvertedPolygonRendererWidget::mRendererComboBox_currentIndexChanged );
55 connect( mMergePolygonsCheckBox, &QCheckBox::stateChanged,
this, &QgsInvertedPolygonRendererWidget::mMergePolygonsCheckBox_stateChanged );
68 mMergePolygonsCheckBox->blockSignals(
true );
69 mMergePolygonsCheckBox->setCheckState(
mRenderer->preprocessingEnabled() ? Qt::Checked : Qt::Unchecked );
70 mMergePolygonsCheckBox->blockSignals(
false );
72 int currentEmbeddedIdx = 0;
75 QStringList::const_iterator it = rendererList.constBegin();
77 mRendererComboBox->blockSignals(
true );
78 for ( ; it != rendererList.constEnd(); ++it, ++idx )
80 if ( *it != QLatin1String(
"invertedPolygonRenderer" ) )
85 if ( embeddedRenderer && embeddedRenderer->
type() == m->
name() )
88 currentEmbeddedIdx = idx;
92 mRendererComboBox->blockSignals(
false );
94 int oldIdx = mRendererComboBox->currentIndex();
95 mRendererComboBox->setCurrentIndex( currentEmbeddedIdx );
96 if ( oldIdx == currentEmbeddedIdx )
99 mRendererComboBox_currentIndexChanged( currentEmbeddedIdx );
108 if ( embeddedRenderer )
123 void QgsInvertedPolygonRendererWidget::mRendererComboBox_currentIndexChanged(
int index )
125 QString rendererId = mRendererComboBox->itemData( index ).toString();
133 if ( layout()->count() > 2 )
136 layout()->takeAt( 2 );
142 void QgsInvertedPolygonRendererWidget::mMergePolygonsCheckBox_stateChanged(
int state )
144 mRenderer->setPreprocessingEnabled( state == Qt::Checked );
static Type singleType(Type type)
Returns the single type for a WKB type.
QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
QStringList renderersList(QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) const
Returns a list of available renderers.
static QgsInvertedPolygonRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
Type
The WKB type describes the number of dimensions a geometry has.
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted...
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
QgsRendererAbstractMetadata * rendererMetadata(const QString &rendererName)
Returns the metadata for a specified renderer.
Represents a vector layer which manages a vector based data sets.
static Type flatType(Type type)
Returns the flat type for a WKB type.
static QgsRendererRegistry * rendererRegistry()
Returns the application's renderer registry, used for managing vector layer renderers.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.