44 QGridLayout *layout =
new QGridLayout(
this );
45 QLabel *label =
new QLabel( tr(
"The inverted polygon renderer only applies to polygon and multipolygon layers. \n" 46 "'%1' is not a polygon layer and then cannot be displayed" )
47 .arg( layer->
name() ),
this );
48 this->setLayout( layout );
49 layout->addWidget( label );
53 connect( mRendererComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsInvertedPolygonRendererWidget::mRendererComboBox_currentIndexChanged );
54 connect( mMergePolygonsCheckBox, &QCheckBox::stateChanged,
this, &QgsInvertedPolygonRendererWidget::mMergePolygonsCheckBox_stateChanged );
67 mMergePolygonsCheckBox->blockSignals(
true );
68 mMergePolygonsCheckBox->setCheckState(
mRenderer->preprocessingEnabled() ? Qt::Checked : Qt::Unchecked );
69 mMergePolygonsCheckBox->blockSignals(
false );
71 int currentEmbeddedIdx = 0;
74 QStringList::const_iterator it = rendererList.constBegin();
76 mRendererComboBox->blockSignals(
true );
77 for ( ; it != rendererList.constEnd(); ++it, ++idx )
79 if ( *it != QLatin1String(
"invertedPolygonRenderer" ) )
84 if ( embeddedRenderer && embeddedRenderer->
type() == m->
name() )
87 currentEmbeddedIdx = idx;
91 mRendererComboBox->blockSignals(
false );
93 int oldIdx = mRendererComboBox->currentIndex();
94 mRendererComboBox->setCurrentIndex( currentEmbeddedIdx );
95 if ( oldIdx == currentEmbeddedIdx )
98 mRendererComboBox_currentIndexChanged( currentEmbeddedIdx );
107 if ( embeddedRenderer )
122 void QgsInvertedPolygonRendererWidget::mRendererComboBox_currentIndexChanged(
int index )
124 QString rendererId = mRendererComboBox->itemData( index ).toString();
132 if ( layout()->count() > 2 )
135 layout()->takeAt( 2 );
141 void QgsInvertedPolygonRendererWidget::mMergePolygonsCheckBox_stateChanged(
int state )
143 mRenderer->setPreprocessingEnabled( state == Qt::Checked );
static Type singleType(Type type)
Returns the single type for a WKB type.
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...
QgsWkbTypes::Type wkbType() const override
Returns the WKBType or WKBUnknown in case of error.
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.