QGIS API Documentation  2.99.0-Master (dc72e14)
qgspointdisplacementrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspointdisplacementrendererwidget.h
3  ------------------------------------
4  begin : January 26, 2010
5  copyright : (C) 2010 by Marco Hugentobler
6  email : marco at hugis dot net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSPOINTDISPLACEMENTRENDERERWIDGET_H
19 #define QGSPOINTDISPLACEMENTRENDERERWIDGET_H
20 
21 #include "ui_qgspointdisplacementrendererwidgetbase.h"
22 #include "qgis.h"
23 #include "qgsrendererwidget.h"
25 #include "qgis_gui.h"
26 
28 
32 class GUI_EXPORT QgsPointDisplacementRendererWidget: public QgsRendererWidget, public QgsExpressionContextGenerator, private Ui::QgsPointDisplacementRendererWidgetBase
33 {
34  Q_OBJECT
35  public:
36  static QgsRendererWidget *create( QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer ) SIP_FACTORY;
39 
40  QgsFeatureRenderer *renderer() override;
41  void setContext( const QgsSymbolWidgetContext &context ) override;
42 
44 
45  private:
46  QgsPointDisplacementRenderer *mRenderer = nullptr;
47 
48  void blockAllSignals( bool block );
49  void setupBlankUi( const QString &layerName );
50 
51  private slots:
52  void on_mLabelFieldComboBox_currentIndexChanged( const QString &text );
53  void on_mRendererComboBox_currentIndexChanged( int index );
54  void on_mPlacementComboBox_currentIndexChanged( int index );
55  void labelFontChanged();
56  void on_mCircleWidthSpinBox_valueChanged( double d );
57  void on_mCircleColorButton_colorChanged( const QColor &newColor );
58  void on_mDistanceSpinBox_valueChanged( double d );
59  void on_mDistanceUnitWidget_changed();
60  void on_mLabelColorButton_colorChanged( const QColor &newColor );
61  void on_mCircleModificationSpinBox_valueChanged( double d );
62  void on_mScaleDependentLabelsCheckBox_stateChanged( int state );
63  void minLabelScaleChanged( double scale );
64  void on_mRendererSettingsButton_clicked();
65  void centerSymbolChanged();
66  void updateRendererFromWidget();
67 };
68 
69 #endif // QGSPOINTDISPLACEMENTRENDERERWIDGET_H
virtual QgsFeatureRenderer * renderer()=0
return pointer to the renderer (no transfer of ownership)
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the renderer widget is shown, e.g., the associated map canvas and expressio...
Base class for renderer settings widgets.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
#define SIP_FACTORY
Definition: qgis_sip.h:69
Abstract interface for generating an expression context.
A renderer that automatically displaces points with the same geographic location. ...
Represents a vector layer which manages a vector based data sets.