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 );
65 mMergePolygonsCheckBox->blockSignals(
true );
66 mMergePolygonsCheckBox->setCheckState(
mRenderer->preprocessingEnabled() ? Qt::Checked : Qt::Unchecked );
67 mMergePolygonsCheckBox->blockSignals(
false );
69 int currentEmbeddedIdx = 0;
74 mRendererComboBox->blockSignals(
true );
75 for ( ; it != rendererList.
constEnd(); ++it, ++idx )
77 if ( *it !=
"invertedPolygonRenderer" )
82 if ( embeddedRenderer && embeddedRenderer->
type() == m->
name() )
85 currentEmbeddedIdx = idx;
89 mRendererComboBox->blockSignals(
false );
91 int oldIdx = mRendererComboBox->currentIndex();
92 mRendererComboBox->setCurrentIndex( currentEmbeddedIdx );
93 if ( oldIdx == currentEmbeddedIdx )
96 on_mRendererComboBox_currentIndexChanged( currentEmbeddedIdx );
105 if ( embeddedRenderer )
120 void QgsInvertedPolygonRendererWidget::on_mRendererComboBox_currentIndexChanged(
int index )
122 QString rendererId = mRendererComboBox->itemData( index ).toString();
130 if (
layout()->count() > 2 )
139 void QgsInvertedPolygonRendererWidget::on_mMergePolygonsCheckBox_stateChanged(
int state )
141 mRenderer->setPreprocessingEnabled( state == Qt::Checked );
static QgsRendererV2Registry * instance()
Returns a pointer to the QgsRendererV2Registry singleton.
QGis::WkbType wkbType() const
Returns the WKBType or WKBUnknown in case of error.
static QgsInvertedPolygonRenderer * convertFromRenderer(const QgsFeatureRendererV2 *renderer)
Creates a QgsInvertedPolygonRenderer by a conversion from an existing renderer.
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
QgsRendererV2AbstractMetadata * rendererMetadata(const QString &rendererName)
Returns the metadata for a specified renderer.
static QgsWKBTypes::Type fromOldWkbType(QGis::WkbType type)
Converts from old (pre 2.10) WKB type (OGR) to new WKB type.
virtual QgsFeatureRendererV2 * clone() const =0
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted...
static Type flatType(Type type)
Returns the flat type for a WKB type.
QString name
Read property of QString layerName.
QStringList renderersList(QgsRendererV2AbstractMetadata::LayerTypes layerTypes=QgsRendererV2AbstractMetadata::All) const
Returns a list of available renderers.
const_iterator constEnd() const
const_iterator constBegin() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
virtual QLayoutItem * takeAt(int index)=0
static Type singleType(Type type)
Returns the single type for a WKB type.