36 #include <QMessageBox> 50 if ( !iconName.isEmpty() )
54 if ( pix.
load( iconPath ) )
64 static bool initialized =
false;
82 , mActiveWidget( nullptr )
83 , mPaintEffect( nullptr )
84 , mMapCanvas( nullptr )
111 connect( mLayerTransparencySlider, SIGNAL( valueChanged(
int ) ), mLayerTransparencySpnBx, SLOT( setValue(
int ) ) );
112 connect( mLayerTransparencySpnBx, SIGNAL( valueChanged(
int ) ), mLayerTransparencySlider, SLOT( setValue(
int ) ) );
128 Q_FOREACH (
const QString& name, renderers )
134 cboRenderers->setCurrentIndex( -1 );
141 checkboxEnableOrderBy->setChecked(
true );
145 btnOrderBy->setEnabled(
false );
146 checkboxEnableOrderBy->setChecked(
false );
147 lineEditOrderBy->setEnabled(
false );
149 lineEditOrderBy->setReadOnly(
true );
150 connect( checkboxEnableOrderBy, SIGNAL( toggled(
bool ) ), btnOrderBy, SLOT(
setEnabled(
bool ) ) );
151 connect( checkboxEnableOrderBy, SIGNAL( toggled(
bool ) ), lineEditOrderBy, SLOT(
setEnabled(
bool ) ) );
152 connect( btnOrderBy, SIGNAL( clicked(
bool ) ),
this, SLOT( showOrderByDialog() ) );
158 int rendererIdx = cboRenderers->findData( rendererName );
159 cboRenderers->setCurrentIndex( rendererIdx );
162 Q_ASSERT( rendererIdx != -1 &&
"there must be a renderer!" );
181 if ( cboRenderers->currentIndex() == -1 )
183 QgsDebugMsg(
"No current item -- this should never happen!" );
187 QString rendererName = cboRenderers->itemData( cboRenderers->currentIndex() ).toString();
232 stackedWidget->setCurrentWidget( pageNoWidget );
270 void QgsRendererV2PropertiesDialog::showOrderByDialog()
286 checkboxEnableOrderBy->setChecked( orderByEnabled );
QgsMapCanvas * mMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
static QgsRendererV2Registry * instance()
QgsFeatureRequest::OrderBy mOrderBy
This is a dialog to build and manage a list of order by clauses.
void setContentsMargins(int left, int top, int right, int bottom)
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Set the order by to manage.
QgsFeatureRequest::OrderBy orderBy() const
Get the order in which features shall be processed by this renderer.
static QString defaultThemePath()
Returns the path to the default theme directory.
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer...
void setRendererV2(QgsFeatureRendererV2 *r)
Set renderer which will be invoked to represent this layer.
void setFeatureBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering each feature.
void setLayerTransparency(int layerTransparency)
Set the transparency for the vector layer.
QString iconPath(const QString &iconFile)
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
Map canvas is a class for displaying all GIS data types on a canvas.
QgsRendererV2AbstractMetadata * rendererMetadata(const QString &rendererName)
get metadata for particular renderer. Returns NULL if not found in registry.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
static void _initRendererWidgetFunctions()
QString CORE_EXPORT dump() const
Dumps the content to an SQL equivalent syntax.
const char * name() const
virtual QgsFeatureRendererV2 * clone() const =0
QgsFeatureRendererV2 * rendererV2()
Return renderer V2.
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
QStringList renderersList()
return a list of available renderers
void layerVariablesChanged()
Emitted when expression context variables on the associated vector layers have been changed...
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer...
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the renderer.
bool load(const QString &fileName, const char *format, QFlags< Qt::ImageConversionFlag > flags)
QgsRendererV2PropertiesDialog(QgsVectorLayer *layer, QgsStyleV2 *style, bool embedded=false)
static bool _initRenderer(const QString &name, QgsRendererV2WidgetFunc f, const QString &iconName=QString())
void rendererChanged()
called when user changes renderer type
int layerTransparency() const
Returns the current transparency for the vector layer.
virtual void keyPressEvent(QKeyEvent *e)
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
void keyPressEvent(QKeyEvent *event) override
Reimplements dialog keyPress event so we can ignore it.
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the renderer.
QgsPaintEffect * mPaintEffect
~QgsRendererV2PropertiesDialog()
QgsFeatureRequest::OrderBy orderBy()
Get the order by defined in the dialog.
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.
QgsRendererV2Widget *(* QgsRendererV2WidgetFunc)(QgsVectorLayer *, QgsStyleV2 *, QgsFeatureRendererV2 *)
Represents a list of OrderByClauses, with the most important first and the least important last...
QgsRendererV2Widget * mActiveWidget