QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsrendererpropertiesdialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererpropertiesdialog.cpp
3  ---------------------
4  begin : December 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
16 
17 #include "qgsrenderer.h"
18 #include "qgsrendererregistry.h"
19 
20 #include "qgsrendererwidget.h"
29 #include "qgs25drendererwidget.h"
31 #include "qgspanelwidget.h"
32 #include "qgspainteffect.h"
33 
34 #include "qgsorderbydialog.h"
35 #include "qgsapplication.h"
36 #include "qgslogger.h"
37 #include "qgsvectorlayer.h"
38 
39 #include <QKeyEvent>
40 #include <QMessageBox>
41 
42 static bool _initRenderer( const QString &name, QgsRendererWidgetFunc f, const QString &iconName = QString() )
43 {
46  if ( !am )
47  return false;
48  QgsRendererMetadata *m = dynamic_cast<QgsRendererMetadata *>( am );
49  if ( !m )
50  return false;
51 
52  m->setWidgetFunction( f );
53 
54  if ( !iconName.isEmpty() )
55  {
56  m->setIcon( QgsApplication::getThemeIcon( iconName ) );
57  }
58 
59  QgsDebugMsgLevel( "Set for " + name, 2 );
60  return true;
61 }
62 
63 static void _initRendererWidgetFunctions()
64 {
65  static bool sInitialized = false;
66  if ( sInitialized )
67  return;
68 
69  _initRenderer( QStringLiteral( "singleSymbol" ), QgsSingleSymbolRendererWidget::create, QStringLiteral( "rendererSingleSymbol.svg" ) );
70  _initRenderer( QStringLiteral( "categorizedSymbol" ), QgsCategorizedSymbolRendererWidget::create, QStringLiteral( "rendererCategorizedSymbol.svg" ) );
71  _initRenderer( QStringLiteral( "graduatedSymbol" ), QgsGraduatedSymbolRendererWidget::create, QStringLiteral( "rendererGraduatedSymbol.svg" ) );
72  _initRenderer( QStringLiteral( "RuleRenderer" ), QgsRuleBasedRendererWidget::create, QStringLiteral( "rendererRuleBasedSymbol.svg" ) );
73  _initRenderer( QStringLiteral( "pointDisplacement" ), QgsPointDisplacementRendererWidget::create, QStringLiteral( "rendererPointDisplacementSymbol.svg" ) );
74  _initRenderer( QStringLiteral( "pointCluster" ), QgsPointClusterRendererWidget::create, QStringLiteral( "rendererPointClusterSymbol.svg" ) );
75  _initRenderer( QStringLiteral( "invertedPolygonRenderer" ), QgsInvertedPolygonRendererWidget::create, QStringLiteral( "rendererInvertedSymbol.svg" ) );
76  _initRenderer( QStringLiteral( "heatmapRenderer" ), QgsHeatmapRendererWidget::create, QStringLiteral( "rendererHeatmapSymbol.svg" ) );
77  _initRenderer( QStringLiteral( "25dRenderer" ), Qgs25DRendererWidget::create, QStringLiteral( "renderer25dSymbol.svg" ) );
78  _initRenderer( QStringLiteral( "nullSymbol" ), QgsNullSymbolRendererWidget::create, QStringLiteral( "rendererNullSymbol.svg" ) );
79  sInitialized = true;
80 }
81 
82 QgsRendererPropertiesDialog::QgsRendererPropertiesDialog( QgsVectorLayer *layer, QgsStyle *style, bool embedded, QWidget *parent )
83  : QDialog( parent )
84  , mLayer( layer )
85  , mStyle( style )
86 
87 {
88  setupUi( this );
90  mLayerRenderingGroupBox->setSettingGroup( QStringLiteral( "layerRenderingGroupBox" ) );
91 
92  // can be embedded in vector layer properties
93  if ( embedded )
94  {
95  buttonBox->hide();
96  layout()->setContentsMargins( 0, 0, 0, 0 );
97  }
98 
99  // initialize registry's widget functions
100  _initRendererWidgetFunctions();
101 
103  QStringList renderers = reg->renderersList( mLayer );
104  const auto constRenderers = renderers;
105  for ( const QString &name : constRenderers )
106  {
108  cboRenderers->addItem( m->icon(), m->visibleName(), name );
109  }
110 
111  cboRenderers->setCurrentIndex( -1 ); // set no current renderer
112 
113  connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsRendererPropertiesDialog::onOK );
114 
115  // connect layer opacity slider and spin box
116  connect( cboRenderers, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererPropertiesDialog::rendererChanged );
117  connect( checkboxEnableOrderBy, &QAbstractButton::toggled, btnOrderBy, &QWidget::setEnabled );
118  connect( btnOrderBy, &QAbstractButton::clicked, this, &QgsRendererPropertiesDialog::showOrderByDialog );
119 
120  syncToLayer();
121 
122  QList<QWidget *> widgets;
123  widgets << mOpacityWidget
124  << cboRenderers
125  << checkboxEnableOrderBy
126  << mBlendModeComboBox
127  << mFeatureBlendComboBox
128  << mEffectWidget;
129 
130  connectValueChanged( widgets, SIGNAL( widgetChanged() ) );
131  connect( mEffectWidget, &QgsPanelWidget::showPanel, this, &QgsRendererPropertiesDialog::openPanel );
132 }
133 
134 void QgsRendererPropertiesDialog::connectValueChanged( const QList<QWidget *> &widgets, const char *slot )
135 {
136  for ( QWidget *widget : widgets )
137  {
138  if ( QgsPropertyOverrideButton *w = qobject_cast<QgsPropertyOverrideButton *>( widget ) )
139  {
140  connect( w, SIGNAL( changed ), this, slot );
141  }
142  else if ( QgsFieldExpressionWidget *w = qobject_cast<QgsFieldExpressionWidget *>( widget ) )
143  {
144  connect( w, SIGNAL( fieldChanged( QString ) ), this, slot );
145  }
146  else if ( QgsOpacityWidget *w = qobject_cast<QgsOpacityWidget *>( widget ) )
147  {
148  connect( w, SIGNAL( opacityChanged( double ) ), this, slot );
149  }
150  else if ( QComboBox *w = qobject_cast<QComboBox *>( widget ) )
151  {
152  connect( w, SIGNAL( currentIndexChanged( int ) ), this, slot );
153  }
154  else if ( QSpinBox *w = qobject_cast<QSpinBox *>( widget ) )
155  {
156  connect( w, SIGNAL( valueChanged( int ) ), this, slot );
157  }
158  else if ( QDoubleSpinBox *w = qobject_cast<QDoubleSpinBox *>( widget ) )
159  {
160  connect( w, SIGNAL( valueChanged( double ) ), this, slot );
161  }
162  else if ( QgsColorButton *w = qobject_cast<QgsColorButton *>( widget ) )
163  {
164  connect( w, SIGNAL( colorChanged( QColor ) ), this, slot );
165  }
166  else if ( QCheckBox *w = qobject_cast<QCheckBox *>( widget ) )
167  {
168  connect( w, SIGNAL( toggled( bool ) ), this, slot );
169  }
170  else if ( QLineEdit *w = qobject_cast<QLineEdit *>( widget ) )
171  {
172  connect( w, SIGNAL( textEdited( QString ) ), this, slot );
173  connect( w, SIGNAL( textChanged( QString ) ), this, slot );
174  }
175  else if ( QgsEffectStackCompactWidget *w = qobject_cast<QgsEffectStackCompactWidget *>( widget ) )
176  {
177  connect( w, SIGNAL( changed() ), this, slot );
178  }
179  }
180 }
181 
183 {
184  delete mPaintEffect;
185 }
186 
188 {
189  mMapCanvas = canvas;
190  if ( mActiveWidget )
191  {
192  QgsSymbolWidgetContext context;
193  context.setMapCanvas( mMapCanvas );
194  mActiveWidget->setContext( context );
195  }
196 }
197 
199 {
200  mMapCanvas = context.mapCanvas();
201  mMessageBar = context.messageBar();
202  if ( mActiveWidget )
203  {
204  mActiveWidget->setContext( context );
205  }
206 }
207 
209 {
210  mDockMode = dockMode;
211  mEffectWidget->setDockMode( dockMode );
212  if ( mActiveWidget )
213  mActiveWidget->setDockMode( mDockMode );
214 }
215 
216 
218 {
219  if ( cboRenderers->currentIndex() == -1 )
220  {
221  QgsDebugMsg( QStringLiteral( "No current item -- this should never happen!" ) );
222  return;
223  }
224 
225  QString rendererName = cboRenderers->currentData().toString();
226 
227  //Retrieve the previous renderer: from the old active widget if possible, otherwise from the layer
228  QgsFeatureRenderer *oldRenderer = nullptr;
230  {
231  oldRenderer = mActiveWidget->renderer()->clone();
232  }
233  else
234  {
235  oldRenderer = mLayer->renderer()->clone();
236  }
237 
238  // get rid of old active widget (if any)
239  if ( mActiveWidget )
240  {
241  stackedWidget->removeWidget( mActiveWidget );
242 
243  delete mActiveWidget;
244  mActiveWidget = nullptr;
245  }
246 
247  QgsRendererWidget *w = nullptr;
249  if ( m )
250  w = m->createRendererWidget( mLayer, mStyle, oldRenderer );
251  delete oldRenderer;
252 
253  if ( w )
254  {
255  // instantiate the widget and set as active
256  mActiveWidget = w;
257  stackedWidget->addWidget( mActiveWidget );
258  stackedWidget->setCurrentWidget( mActiveWidget );
259  if ( mActiveWidget->renderer() )
260  {
261  if ( mMapCanvas || mMessageBar )
262  {
263  QgsSymbolWidgetContext context;
264  context.setMapCanvas( mMapCanvas );
265  context.setMessageBar( mMessageBar );
266  mActiveWidget->setContext( context );
267  }
268  changeOrderBy( mActiveWidget->renderer()->orderBy(), mActiveWidget->renderer()->orderByEnabled() );
270  }
273  w->setDockMode( mDockMode );
274  }
275  else
276  {
277  // set default "no edit widget available" page
278  stackedWidget->setCurrentWidget( pageNoWidget );
279  }
280 }
281 
283 {
284  if ( !mActiveWidget || !mLayer )
285  {
286  return;
287  }
288 
290 
292  if ( renderer )
293  {
294  renderer->setPaintEffect( mPaintEffect->clone() );
295  // set the order by
296  renderer->setOrderBy( mOrderBy );
297  renderer->setOrderByEnabled( checkboxEnableOrderBy->isChecked() );
298 
299  mLayer->setRenderer( renderer->clone() );
300  }
301 
302  // set the blend modes for the layer
303  mLayer->setBlendMode( mBlendModeComboBox->blendMode() );
304  mLayer->setFeatureBlendMode( mFeatureBlendComboBox->blendMode() );
305 
306  // set opacity for the layer
307  mLayer->setOpacity( mOpacityWidget->opacity() );
308 }
309 
311 {
312  apply();
313  accept();
314 }
315 
317 {
318  if ( mDockMode )
319  {
320  emit showPanel( panel );
321  }
322  else
323  {
324  // Show the dialog version if no one is connected
325  QDialog *dlg = new QDialog();
326  QString key = QStringLiteral( "/UI/paneldialog/%1" ).arg( panel->panelTitle() );
327  QgsSettings settings;
328  dlg->restoreGeometry( settings.value( key ).toByteArray() );
329  dlg->setWindowTitle( panel->panelTitle() );
330  dlg->setLayout( new QVBoxLayout() );
331  dlg->layout()->addWidget( panel );
332  QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok );
333  connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
334  dlg->layout()->addWidget( buttonBox );
335  dlg->exec();
336  settings.setValue( key, dlg->saveGeometry() );
337  panel->acceptPanel();
338  }
339 }
340 
341 void QgsRendererPropertiesDialog::syncToLayer()
342 {
343  // Blend mode
344  mBlendModeComboBox->setBlendMode( mLayer->blendMode() );
345 
346  // Feature blend mode
347  mFeatureBlendComboBox->setBlendMode( mLayer->featureBlendMode() );
348 
349  // Layer opacity
350  mOpacityWidget->setOpacity( mLayer->opacity() );
351 
352  //paint effect widget
353  if ( mLayer->renderer() )
354  {
355  if ( mLayer->renderer()->paintEffect() )
356  {
358  mEffectWidget->setPaintEffect( mPaintEffect );
359  }
360 
362  }
363 
364  // setup slot rendererChanged()
365  //setup order by
366  if ( mLayer->renderer() &&
368  {
369  checkboxEnableOrderBy->setChecked( true );
370  }
371  else
372  {
373  btnOrderBy->setEnabled( false );
374  checkboxEnableOrderBy->setChecked( false );
375  }
376 
377  if ( mLayer->renderer() )
378  {
379  // set current renderer from layer
380  QString rendererName = mLayer->renderer()->type();
381 
382  int rendererIdx = cboRenderers->findData( rendererName );
383  cboRenderers->setCurrentIndex( rendererIdx );
384 
385  // no renderer found... this mustn't happen
386  Q_ASSERT( rendererIdx != -1 && "there must be a renderer!" );
387  }
388 
389 }
390 
391 void QgsRendererPropertiesDialog::showOrderByDialog()
392 {
393  QgsOrderByDialog dlg( mLayer, this );
394 
395  dlg.setOrderBy( mOrderBy );
396  if ( dlg.exec() )
397  {
398  mOrderBy = dlg.orderBy();
399  emit widgetChanged();
400  }
401 }
402 
403 void QgsRendererPropertiesDialog::changeOrderBy( const QgsFeatureRequest::OrderBy &orderBy, bool orderByEnabled )
404 {
405  mOrderBy = orderBy;
406  checkboxEnableOrderBy->setChecked( orderByEnabled );
407 }
408 
409 void QgsRendererPropertiesDialog::updateUIState( bool hidden )
410 {
411  mLayerRenderingGroupBox->setHidden( hidden );
412  cboRenderers->setHidden( hidden );
413 }
414 
415 
417 {
418  // Ignore the ESC key to avoid close the dialog without the properties window
419  if ( !isWindow() && e->key() == Qt::Key_Escape )
420  {
421  e->ignore();
422  }
423  else
424  {
425  QDialog::keyPressEvent( e );
426  }
427 }
QgsVectorLayer::setRenderer
void setRenderer(QgsFeatureRenderer *r)
Sets renderer which will be invoked to represent this layer.
Definition: qgsvectorlayer.cpp:3646
QgsRendererWidget::renderer
virtual QgsFeatureRenderer * renderer()=0
Returns pointer to the renderer (no transfer of ownership)
qgsrulebasedrendererwidget.h
QgsRendererPropertiesDialog::~QgsRendererPropertiesDialog
~QgsRendererPropertiesDialog() override
Definition: qgsrendererpropertiesdialog.cpp:182
QgsRendererPropertiesDialog::showPanel
void showPanel(QgsPanelWidget *panel)
Emit when you require a panel to be show in the interface.
QgsRendererPropertiesDialog::mOrderBy
QgsFeatureRequest::OrderBy mOrderBy
Definition: qgsrendererpropertiesdialog.h:161
QgsSymbolWidgetContext::mapCanvas
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Definition: qgssymbolwidgetcontext.cpp:54
QgsApplication::rendererRegistry
static QgsRendererRegistry * rendererRegistry()
Returns the application's renderer registry, used for managing vector layer renderers.
Definition: qgsapplication.cpp:2148
QgsVectorLayer::featureBlendMode
QPainter::CompositionMode featureBlendMode() const
Returns the current blending mode for features.
Definition: qgsvectorlayer.cpp:4338
qgspointdisplacementrendererwidget.h
QgsRendererPropertiesDialog::apply
void apply()
Apply the changes from the dialog to the layer.
Definition: qgsrendererpropertiesdialog.cpp:282
QgsRendererPropertiesDialog::mPaintEffect
QgsPaintEffect * mPaintEffect
Definition: qgsrendererpropertiesdialog.h:156
QgsRendererAbstractMetadata::setIcon
void setIcon(const QIcon &icon)
Sets an icon representing the renderer.
Definition: qgsrendererregistry.h:94
QgsApplication::getThemeIcon
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Definition: qgsapplication.cpp:626
QgsSettings::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Definition: qgssettings.cpp:174
QgsFeatureRenderer::setOrderByEnabled
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer.
Definition: qgsrenderer.cpp:450
QgsRuleBasedRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Definition: qgsrulebasedrendererwidget.cpp:48
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsMapLayer::blendMode
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
Definition: qgsmaplayer.cpp:212
QgsPointClusterRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Returns a new QgsPointClusterRendererWidget.
Definition: qgspointclusterrendererwidget.cpp:29
qgsheatmaprendererwidget.h
QgsRendererAbstractMetadata::visibleName
QString visibleName() const
Returns a friendly display name of the renderer.
Definition: qgsrendererregistry.h:82
QgsCategorizedSymbolRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Definition: qgscategorizedsymbolrendererwidget.cpp:492
QgsSymbolWidgetContext
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Definition: qgssymbolwidgetcontext.h:36
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:85
qgs25drendererwidget.h
QgsFeatureRenderer::type
QString type() const
Definition: qgsrenderer.h:141
QgsRendererWidget::applyChanges
void applyChanges()
This method should be called whenever the renderer is actually set on the layer.
Definition: qgsrendererwidget.cpp:347
QgsRendererPropertiesDialog::setDockMode
void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
Definition: qgsrendererpropertiesdialog.cpp:208
QgsSettings
This class is a composition of two QSettings instances:
Definition: qgssettings.h:62
QgsMapLayer::setBlendMode
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
Definition: qgsmaplayer.cpp:202
QgsRendererPropertiesDialog::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
Definition: qgsrendererpropertiesdialog.cpp:187
QgsDebugMsg
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
qgspainteffect.h
QgsRendererPropertiesDialog::rendererChanged
void rendererChanged()
called when user changes renderer type
Definition: qgsrendererpropertiesdialog.cpp:217
QgsHeatmapRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Static creation method.
Definition: qgsheatmaprendererwidget.cpp:33
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition: qgspropertyoverridebutton.h:51
QgsSymbolWidgetContext::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Definition: qgssymbolwidgetcontext.cpp:49
QgsFeatureRenderer::orderBy
QgsFeatureRequest::OrderBy orderBy() const
Gets the order in which features shall be processed by this renderer.
Definition: qgsrenderer.cpp:435
QgsPanelWidget::showPanel
void showPanel(QgsPanelWidget *panel)
Emit when you require a panel to be show in the interface.
qgssinglesymbolrendererwidget.h
qgsapplication.h
QgsRendererPropertiesDialog::mActiveWidget
QgsRendererWidget * mActiveWidget
Definition: qgsrendererpropertiesdialog.h:154
QgsGui::enableAutoGeometryRestore
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition: qgsgui.cpp:139
QgsSymbolWidgetContext::setMessageBar
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
Definition: qgssymbolwidgetcontext.cpp:59
QgsRendererWidgetFunc
QgsRendererWidget *(* QgsRendererWidgetFunc)(QgsVectorLayer *, QgsStyle *, QgsFeatureRenderer *)
Definition: qgsrendererregistry.h:135
qgsgraduatedsymbolrendererwidget.h
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:30
QgsRendererPropertiesDialog::layerVariablesChanged
void layerVariablesChanged()
Emitted when expression context variables on the associated vector layers have been changed.
qgsorderbydialog.h
QgsEffectStackCompactWidget
A small widget consisting of a checkbox for enabling/disabling an effect stack and a button for openi...
Definition: qgseffectstackpropertieswidget.h:219
QgsFeatureRenderer::clone
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QgsPanelWidget::acceptPanel
void acceptPanel()
Accept the panel.
Definition: qgspanelwidget.cpp:107
qgspointclusterrendererwidget.h
qgsrendererregistry.h
QgsPaintEffect::clone
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
QgsRendererWidget::setDockMode
void setDockMode(bool dockMode) override
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
Definition: qgsrendererwidget.cpp:352
QgsPanelWidget::widgetChanged
void widgetChanged()
Emitted when the widget state changes.
QgsRendererPropertiesDialog::QgsRendererPropertiesDialog
QgsRendererPropertiesDialog(QgsVectorLayer *layer, QgsStyle *style, bool embedded=false, QWidget *parent=nullptr)
Constructor for QgsRendererPropertiesDialog.
Definition: qgsrendererpropertiesdialog.cpp:82
QgsPanelWidget::panelTitle
QString panelTitle()
The title of the panel.
Definition: qgspanelwidget.h:50
QgsInvertedPolygonRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Static creation method.
Definition: qgsinvertedpolygonrendererwidget.cpp:25
QgsOpacityWidget
A widget for setting an opacity value.
Definition: qgsopacitywidget.h:33
QgsSettings::setValue
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
Definition: qgssettings.cpp:289
qgsrenderer.h
QgsRendererPropertiesDialog::onOK
void onOK()
Apply and accept the changes for the dialog.
Definition: qgsrendererpropertiesdialog.cpp:310
QgsRendererRegistry::renderersList
QStringList renderersList(QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) const
Returns a list of available renderers.
Definition: qgsrendererregistry.cpp:123
QgsSingleSymbolRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Definition: qgssinglesymbolrendererwidget.cpp:30
QgsRendererWidget
Base class for renderer settings widgets.
Definition: qgsrendererwidget.h:45
QgsRendererPropertiesDialog::mMessageBar
QgsMessageBar * mMessageBar
Definition: qgsrendererpropertiesdialog.h:159
QgsRendererPropertiesDialog::widgetChanged
void widgetChanged()
Emitted when something on the widget has changed.
qgsvectorlayer.h
QgsRendererPropertiesDialog::openPanel
void openPanel(QgsPanelWidget *panel)
Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the ...
Definition: qgsrendererpropertiesdialog.cpp:316
QgsRendererPropertiesDialog::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Definition: qgsrendererpropertiesdialog.cpp:416
QgsRendererPropertiesDialog::mLayer
QgsVectorLayer * mLayer
Definition: qgsrendererpropertiesdialog.h:151
QgsFeatureRenderer
Definition: qgsrenderer.h:103
QgsFeatureRequest::OrderBy
Represents a list of OrderByClauses, with the most important first and the least important last.
Definition: qgsfeaturerequest.h:230
QgsPointDisplacementRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Definition: qgspointdisplacementrendererwidget.cpp:29
QgsRendererMetadata
Convenience metadata class that uses static functions to create renderer and its widget.
Definition: qgsrendererregistry.h:143
QgsStyle
Definition: qgsstyle.h:160
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsFeatureRenderer::orderByEnabled
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer.
Definition: qgsrenderer.cpp:445
qgsnullsymbolrendererwidget.h
QgsRendererMetadata::setWidgetFunction
void setWidgetFunction(QgsRendererWidgetFunc f)
Definition: qgsrendererregistry.h:193
qgsinvertedpolygonrendererwidget.h
QgsRendererWidget::layerVariablesChanged
void layerVariablesChanged()
Emitted when expression context variables on the associated vector layers have been changed.
QgsColorButton
A cross platform button subclass for selecting colors.
Definition: qgscolorbutton.h:36
QgsRendererPropertiesDialog::mStyle
QgsStyle * mStyle
Definition: qgsrendererpropertiesdialog.h:152
qgsrendererwidget.h
QgsFeatureRenderer::setPaintEffect
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the renderer.
Definition: qgsrenderer.cpp:429
QgsGraduatedSymbolRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Definition: qgsgraduatedsymbolrendererwidget.cpp:410
QgsFeatureRenderer::setOrderBy
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
Definition: qgsrenderer.cpp:440
QgsSymbolWidgetContext::messageBar
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
Definition: qgssymbolwidgetcontext.cpp:64
QgsRendererAbstractMetadata::icon
QIcon icon() const
Returns an icon representing the renderer.
Definition: qgsrendererregistry.h:88
qgscategorizedsymbolrendererwidget.h
qgsrendererpropertiesdialog.h
QgsVectorLayer::opacity
double opacity
Definition: qgsvectorlayer.h:395
QgsFeatureRenderer::paintEffect
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the renderer.
Definition: qgsrenderer.cpp:424
qgslogger.h
QgsRendererPropertiesDialog::setContext
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the dialog is shown, e.g., the associated map canvas and expression context...
Definition: qgsrendererpropertiesdialog.cpp:198
QgsRendererAbstractMetadata::createRendererWidget
virtual QgsRendererWidget * createRendererWidget(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *oldRenderer)
Returns new instance of settings widget for the renderer.
Definition: qgsrendererregistry.h:115
qgspanelwidget.h
QgsRendererRegistry
Registry of renderers.
Definition: qgsrendererregistry.h:225
QgsFieldExpressionWidget
The QgsFieldExpressionWidget class reates a widget to choose fields and edit expressions It contains ...
Definition: qgsfieldexpressionwidget.h:47
QgsRendererRegistry::rendererMetadata
QgsRendererAbstractMetadata * rendererMetadata(const QString &rendererName)
Returns the metadata for a specified renderer.
Definition: qgsrendererregistry.cpp:118
Qgs25DRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Static creation method.
Definition: qgs25drendererwidget.cpp:115
QgsRendererAbstractMetadata
Stores metadata about one renderer class.
Definition: qgsrendererregistry.h:42
QgsRendererWidget::setContext
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expressio...
Definition: qgsrendererwidget.cpp:337
QgsVectorLayer::setOpacity
void setOpacity(double opacity)
Sets the opacity for the vector layer, where opacity is a value between 0 (totally transparent) and 1...
Definition: qgsvectorlayer.cpp:4343
QgsRendererPropertiesDialog::mMapCanvas
QgsMapCanvas * mMapCanvas
Definition: qgsrendererpropertiesdialog.h:158
QgsVectorLayer::setFeatureBlendMode
void setFeatureBlendMode(QPainter::CompositionMode blendMode)
Sets the blending mode used for rendering each feature.
Definition: qgsvectorlayer.cpp:4328
QgsNullSymbolRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Creates a new QgsNullSymbolRendererWidget object.
Definition: qgsnullsymbolrendererwidget.cpp:22
QgsOrderByDialog
This is a dialog to build and manage a list of order by clauses.
Definition: qgsorderbydialog.h:38
QgsVectorLayer::renderer
QgsFeatureRenderer * renderer()
Returns renderer.
Definition: qgsvectorlayer.h:892
QgsRendererPropertiesDialog::connectValueChanged
void connectValueChanged(const QList< QWidget * > &widgets, const char *slot)
Connect the given slot to the value changed event for the set of widgets Each widget is checked for t...
Definition: qgsrendererpropertiesdialog.cpp:134