QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
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 )
130 void QgsInvertedPolygonRendererWidget::mRendererComboBox_currentIndexChanged(
int index )
132 QString rendererId = mRendererComboBox->itemData( index ).toString();
136 std::unique_ptr< QgsFeatureRenderer > oldRenderer(
mRenderer->embeddedRenderer()->clone() );
143 if ( layout()->count() > 2 )
146 layout()->takeAt( 2 );
152 void QgsInvertedPolygonRendererWidget::mMergePolygonsCheckBox_stateChanged(
int state )
154 mRenderer->setPreprocessingEnabled( state == Qt::Checked );
static QgsRendererRegistry * rendererRegistry()
Returns the application's renderer registry, used for managing vector layer renderers.
Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
static QgsInvertedPolygonRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Type
The WKB type describes the number of dimensions a geometry has.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QStringList renderersList(QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) const
Returns a list of available renderers.
Represents a vector layer which manages a vector based data sets.
static Type singleType(Type type) SIP_HOLDGIL
Returns the single type for a WKB type.
QgsRendererAbstractMetadata * rendererMetadata(const QString &rendererName)
Returns the metadata for a specified renderer.
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted,...