QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgssymbollayerwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayerwidget.h - symbol layer widgets
3 
4  ---------------------
5  begin : November 2009
6  copyright : (C) 2009 by Martin Dobias
7  email : wonder dot sk at gmail dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSSYMBOLLAYERWIDGET_H
18 #define QGSSYMBOLLAYERWIDGET_H
19 
21 #include "qgis_sip.h"
22 #include "qgssymbolwidgetcontext.h"
23 #include "qgssymbollayer.h"
24 #include <QWidget>
25 #include <QStandardItemModel>
26 
27 class QgsVectorLayer;
28 class QgsMapCanvas;
29 
34 class GUI_EXPORT QgsSymbolLayerWidget : public QWidget, protected QgsExpressionContextGenerator
35 {
36  Q_OBJECT
37 
38  public:
39 
45  QgsSymbolLayerWidget( QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *vl = nullptr )
46  : QWidget( parent )
47  , mVectorLayer( vl )
48  {}
49 
50  virtual void setSymbolLayer( QgsSymbolLayer *layer ) = 0;
51  virtual QgsSymbolLayer *symbolLayer() = 0;
52 
59  virtual void setContext( const QgsSymbolWidgetContext &context );
60 
66  QgsSymbolWidgetContext context() const;
67 
72  const QgsVectorLayer *vectorLayer() const { return mVectorLayer; }
73 
74  protected:
75 
82  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
83 
85 
86  private:
87  QgsVectorLayer *mVectorLayer = nullptr;
88 
89  QgsMapCanvas *mMapCanvas = nullptr;
90 
91  signals:
92 
97  void changed();
98 
106 
107  protected slots:
108  void updateDataDefinedProperty();
109 
110  private slots:
111  void createAuxiliaryField();
112 
113  private:
114  QgsSymbolWidgetContext mContext;
115 };
116 
118 
119 #include "ui_widget_simpleline.h"
120 
122 
127 class GUI_EXPORT QgsSimpleLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleLine
128 {
129  Q_OBJECT
130 
131  public:
132 
138  QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
139 
145 
146  // from base class
147  void setSymbolLayer( QgsSymbolLayer *layer ) override;
148  QgsSymbolLayer *symbolLayer() override;
149 
150  protected:
151  QgsSimpleLineSymbolLayer *mLayer = nullptr;
152 
153  //creates a new icon for the 'change pattern' button
154  void updatePatternIcon();
155 
156  void resizeEvent( QResizeEvent *event ) override;
157 
158  private slots:
159 
160  void updateAssistantSymbol();
161  void penWidthChanged();
162  void colorChanged( const QColor &color );
163  void penStyleChanged();
164  void offsetChanged();
165  void patternOffsetChanged();
166  void mCustomCheckBox_stateChanged( int state );
167  void mChangePatternButton_clicked();
168  void mPenWidthUnitWidget_changed();
169  void mOffsetUnitWidget_changed();
170  void mDashPatternUnitWidget_changed();
171  void mDrawInsideCheckBox_stateChanged( int state );
172  void patternOffsetUnitChanged();
173 
174  private:
175 
176  std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
177 
178 };
179 
181 
182 #include "ui_widget_simplemarker.h"
183 
185 
190 class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
191 {
192  Q_OBJECT
193 
194  public:
195 
201  QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
202 
208 
209  // from base class
210  void setSymbolLayer( QgsSymbolLayer *layer ) override;
211  QgsSymbolLayer *symbolLayer() override;
212 
213  public slots:
214 
215  void setColorStroke( const QColor &color );
216  void setColorFill( const QColor &color );
217 
218  protected:
219  QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
220 
221  private slots:
222  void setSize();
223  void setAngle();
224  void setOffset();
225  void mSizeUnitWidget_changed();
226  void mOffsetUnitWidget_changed();
227  void mStrokeWidthUnitWidget_changed();
228  void mStrokeStyleComboBox_currentIndexChanged( int index );
229  void mStrokeWidthSpinBox_valueChanged( double d );
230  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
231  void mVerticalAnchorComboBox_currentIndexChanged( int index );
232  void setShape();
233  void updateAssistantSymbol();
234  void penJoinStyleChanged();
235 
236  private:
237 
238  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
239 };
240 
242 
243 #include "ui_widget_simplefill.h"
244 
246 
251 class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
252 {
253  Q_OBJECT
254 
255  public:
256 
262  QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
263 
269 
270  // from base class
271  void setSymbolLayer( QgsSymbolLayer *layer ) override;
272  QgsSymbolLayer *symbolLayer() override;
273 
274  public slots:
275  void setColor( const QColor &color );
276  void setStrokeColor( const QColor &color );
277 
278  protected:
279  QgsSimpleFillSymbolLayer *mLayer = nullptr;
280 
281  private slots:
282  void setBrushStyle();
283  void strokeWidthChanged();
284  void strokeStyleChanged();
285  void offsetChanged();
286  void mStrokeWidthUnitWidget_changed();
287  void mOffsetUnitWidget_changed();
288 
289 };
290 
291 
293 
294 #include "ui_widget_filledmarker.h"
295 
297 
304 class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
305 {
306  Q_OBJECT
307 
308  public:
309 
315  QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
316 
322 
323  // from base class
324  void setSymbolLayer( QgsSymbolLayer *layer ) override;
325  QgsSymbolLayer *symbolLayer() override;
326 
327  protected:
328  QgsFilledMarkerSymbolLayer *mLayer = nullptr;
329 
330  private slots:
331 
332  void updateAssistantSymbol();
333  void setShape();
334  void setSize();
335  void setAngle();
336  void setOffset();
337  void mSizeUnitWidget_changed();
338  void mOffsetUnitWidget_changed();
339  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
340  void mVerticalAnchorComboBox_currentIndexChanged( int index );
341 
342  private:
343 
344  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
345 };
346 
348 
349 #include "ui_widget_gradientfill.h"
350 
352 
357 class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
358 {
359  Q_OBJECT
360 
361  public:
362 
368  QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
369 
375 
376  // from base class
377  void setSymbolLayer( QgsSymbolLayer *layer ) override;
378  QgsSymbolLayer *symbolLayer() override;
379 
380  public slots:
381  void setColor( const QColor &color );
382  void setColor2( const QColor &color );
383 
387  void applyColorRamp();
388  void setGradientType( int index );
389  void setCoordinateMode( int index );
390  void setGradientSpread( int index );
391 
392  protected:
393  QgsGradientFillSymbolLayer *mLayer = nullptr;
394 
395  private slots:
396  void offsetChanged();
397  void referencePointChanged();
398  void mOffsetUnitWidget_changed();
399  void colorModeChanged();
400  void mSpinAngle_valueChanged( double value );
401 
402 };
403 
405 
406 #include "ui_widget_shapeburstfill.h"
407 
409 
414 class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
415 {
416  Q_OBJECT
417 
418  public:
419 
425  QgsShapeburstFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
426 
432 
433  // from base class
434  void setSymbolLayer( QgsSymbolLayer *layer ) override;
435  QgsSymbolLayer *symbolLayer() override;
436 
437  public slots:
438  void setColor( const QColor &color );
439  void setColor2( const QColor &color );
440 
441  protected:
442  QgsShapeburstFillSymbolLayer *mLayer = nullptr;
443 
444  private slots:
445  void colorModeChanged();
446  void mSpinBlurRadius_valueChanged( int value );
447  void mSpinMaxDistance_valueChanged( double value );
448  void mDistanceUnitWidget_changed();
449  void mRadioUseWholeShape_toggled( bool value );
450  void applyColorRamp();
451  void offsetChanged();
452  void mOffsetUnitWidget_changed();
453  void mIgnoreRingsCheckBox_stateChanged( int state );
454 };
455 
457 
458 #include "ui_widget_markerline.h"
459 
461 
466 class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
467 {
468  Q_OBJECT
469 
470  public:
471 
477  QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
478 
484 
485  // from base class
486  void setSymbolLayer( QgsSymbolLayer *layer ) override;
487  QgsSymbolLayer *symbolLayer() override;
488 
489  public slots:
490 
491  void setInterval( double val );
492  void setOffsetAlongLine( double val );
493 
494  protected:
495 
496  QgsMarkerLineSymbolLayer *mLayer = nullptr;
497 
498  private slots:
499  void setRotate();
500  void setOffset();
501  void setPlacement();
502  void mIntervalUnitWidget_changed();
503  void mOffsetUnitWidget_changed();
504  void mOffsetAlongLineUnitWidget_changed();
505  void averageAngleUnitChanged();
506  void setAverageAngle( double val );
507 
508 };
509 
510 
511 #include "ui_widget_hashline.h"
512 
514 
521 class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
522 {
523  Q_OBJECT
524 
525  public:
526 
532  QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
533 
539 
540  // from base class
541  void setSymbolLayer( QgsSymbolLayer *layer ) override;
542  QgsSymbolLayer *symbolLayer() override;
543 
544  private slots:
545 
546  void setInterval( double val );
547  void setOffsetAlongLine( double val );
548  void setHashLength( double val );
549  void setHashAngle( double val );
550 
551  void setRotate();
552  void setOffset();
553  void setPlacement();
554  void mIntervalUnitWidget_changed();
555  void mOffsetUnitWidget_changed();
556  void mOffsetAlongLineUnitWidget_changed();
557  void hashLengthUnitWidgetChanged();
558  void averageAngleUnitChanged();
559  void setAverageAngle( double val );
560  private:
561  QgsHashedLineSymbolLayer *mLayer = nullptr;
562 
563 
564 };
565 
567 
568 #include "ui_widget_svgmarker.h"
569 
571 
576 class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
577 {
578  Q_OBJECT
579 
580  public:
581 
587  QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
588 
594 
595  // from base class
596  void setSymbolLayer( QgsSymbolLayer *layer ) override;
597  QgsSymbolLayer *symbolLayer() override;
598 
599  void setContext( const QgsSymbolWidgetContext &context ) override;
600 
601  public slots:
603  void setSvgPath( const QString &name );
604 
605 
606  protected:
607  // TODO QGIS 4: remove
608 
613  Q_DECL_DEPRECATED void populateList() SIP_DEPRECATED {}
614 
621  void setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors = false );
622 
623  QgsSvgMarkerSymbolLayer *mLayer = nullptr;
624 
625  private slots:
626  void svgSourceChanged( const QString &text );
627  void mChangeColorButton_colorChanged( const QColor &color );
628  void mChangeStrokeColorButton_colorChanged( const QColor &color );
629  void mStrokeWidthSpinBox_valueChanged( double d );
630  void mSizeUnitWidget_changed();
631  void mStrokeWidthUnitWidget_changed();
632  void mOffsetUnitWidget_changed();
633  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
634  void mVerticalAnchorComboBox_currentIndexChanged( int index );
635  void setWidth();
636  void setHeight();
637  void lockAspectRatioChanged( bool locked );
638  void setAngle();
639  void setOffset();
640  void updateAssistantSymbol();
641 
642  private:
643 
644  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
645 
646 };
647 
649 
650 #include "ui_widget_rastermarker.h"
651 
653 
660 class GUI_EXPORT QgsRasterMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterMarker
661 {
662  Q_OBJECT
663 
664  public:
665 
671  QgsRasterMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
672 
678 
679  // from base class
680  void setSymbolLayer( QgsSymbolLayer *layer ) override;
681  QgsSymbolLayer *symbolLayer() override;
682  void setContext( const QgsSymbolWidgetContext &context ) override;
683 
684  protected:
685 
686  QgsRasterMarkerSymbolLayer *mLayer = nullptr;
687 
688  private slots:
689  void imageSourceChanged( const QString &text );
690  void mSizeUnitWidget_changed();
691  void mOffsetUnitWidget_changed();
692  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
693  void mVerticalAnchorComboBox_currentIndexChanged( int index );
694  void setWidth();
695  void setHeight();
696  void setLockAspectRatio( bool locked );
697  void setAngle();
698  void setOffset();
699  void setOpacity( double value );
700  void updatePreviewImage();
701 
702 };
703 
705 
706 #include "ui_widget_rasterfill.h"
707 
709 
714 class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
715 {
716  Q_OBJECT
717 
718  public:
719 
725  QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
726 
732 
733  // from base class
734  void setSymbolLayer( QgsSymbolLayer *layer ) override;
735  QgsSymbolLayer *symbolLayer() override;
736 
737  protected:
738  QgsRasterFillSymbolLayer *mLayer = nullptr;
739 
740  private slots:
741  void imageSourceChanged( const QString &text );
742  void setCoordinateMode( int index );
743  void opacityChanged( double value );
744  void offsetChanged();
745  void mOffsetUnitWidget_changed();
746  void mRotationSpinBox_valueChanged( double d );
747  void mWidthUnitWidget_changed();
748  void mWidthSpinBox_valueChanged( double d );
749 
750  private:
751  void updatePreviewImage();
752 };
753 
755 
756 #include "ui_widget_svgfill.h"
757 
759 
764 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
765 {
766  Q_OBJECT
767 
768  public:
769 
775  QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
776 
782 
783  // from base class
784  void setSymbolLayer( QgsSymbolLayer *layer ) override;
785  QgsSymbolLayer *symbolLayer() override;
786  void setContext( const QgsSymbolWidgetContext &context ) override;
787 
788  protected:
789  QgsSVGFillSymbolLayer *mLayer = nullptr;
790 
797  void updateParamGui( bool resetValues = true );
798 
799  private slots:
800  void mTextureWidthSpinBox_valueChanged( double d );
801  void svgSourceChanged( const QString &text );
802  void setFile( const QString &name );
803  void mRotationSpinBox_valueChanged( double d );
804  void mChangeColorButton_colorChanged( const QColor &color );
805  void mChangeStrokeColorButton_colorChanged( const QColor &color );
806  void mStrokeWidthSpinBox_valueChanged( double d );
807  void mTextureWidthUnitWidget_changed();
808  void mSvgStrokeWidthUnitWidget_changed();
809 };
810 
812 
813 #include "ui_widget_linepatternfill.h"
814 
816 
821 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
822 {
823  Q_OBJECT
824 
825  public:
826 
832  QgsLinePatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
833 
839 
840  void setSymbolLayer( QgsSymbolLayer *layer ) override;
841  QgsSymbolLayer *symbolLayer() override;
842 
843  protected:
844  QgsLinePatternFillSymbolLayer *mLayer = nullptr;
845 
846  private slots:
847  void mAngleSpinBox_valueChanged( double d );
848  void mDistanceSpinBox_valueChanged( double d );
849  void mOffsetSpinBox_valueChanged( double d );
850  void mDistanceUnitWidget_changed();
851  void mOffsetUnitWidget_changed();
852 };
853 
855 
856 #include "ui_widget_pointpatternfill.h"
857 
859 
864 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
865 {
866  Q_OBJECT
867 
868  public:
869 
875  QgsPointPatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
876 
882 
883  void setSymbolLayer( QgsSymbolLayer *layer ) override;
884  QgsSymbolLayer *symbolLayer() override;
885 
886  protected:
888 
889  private slots:
890  void mHorizontalDistanceSpinBox_valueChanged( double d );
891  void mVerticalDistanceSpinBox_valueChanged( double d );
892  void mHorizontalDisplacementSpinBox_valueChanged( double d );
893  void mVerticalDisplacementSpinBox_valueChanged( double d );
894  void mHorizontalOffsetSpinBox_valueChanged( double d );
895  void mVerticalOffsetSpinBox_valueChanged( double d );
896  void mHorizontalDistanceUnitWidget_changed();
897  void mVerticalDistanceUnitWidget_changed();
898  void mHorizontalDisplacementUnitWidget_changed();
899  void mVerticalDisplacementUnitWidget_changed();
900  void mHorizontalOffsetUnitWidget_changed();
901  void mVerticalOffsetUnitWidget_changed();
902 };
903 
904 
906 
907 #include "ui_widget_randommarkerfill.h"
908 
910 
919 class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
920 {
921  Q_OBJECT
922 
923  public:
924 
930  QgsRandomMarkerFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
931 
937 
938  void setSymbolLayer( QgsSymbolLayer *layer ) override;
939  QgsSymbolLayer *symbolLayer() override;
940 
941  private:
942  QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
943 
944  private slots:
945 
946  void countMethodChanged( int );
947  void countChanged( int d );
948  void densityAreaChanged( double d );
949  void densityAreaUnitChanged();
950  void seedChanged( int d );
951 };
952 
954 
955 #include "ui_widget_fontmarker.h"
956 
958 class CharacterWidget;
959 
964 class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
965 {
966  Q_OBJECT
967 
968  public:
969 
975  QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
976 
982 
983  // from base class
984  void setSymbolLayer( QgsSymbolLayer *layer ) override;
985  QgsSymbolLayer *symbolLayer() override;
986 
987  public slots:
988  void setFontFamily( const QFont &font );
989  void setColor( const QColor &color );
990 
995  void setColorStroke( const QColor &color );
996  void setSize( double size );
997  void setAngle( double angle );
998 
1003  void setCharacter( QChar chr );
1004 
1010  void setCharacterFromText( const QString &text );
1011 
1012  protected:
1013  QgsFontMarkerSymbolLayer *mLayer = nullptr;
1014  CharacterWidget *widgetChar = nullptr;
1015 
1016  private slots:
1017 
1022  void setFontStyle( const QString &style );
1023 
1024  void setOffset();
1025  void mSizeUnitWidget_changed();
1026  void mOffsetUnitWidget_changed();
1027  void mStrokeWidthUnitWidget_changed();
1028  void mStrokeWidthSpinBox_valueChanged( double d );
1029 
1030  void populateFontStyleComboBox();
1031  void mFontStyleComboBox_currentIndexChanged( int index );
1032 
1033  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1034  void mVerticalAnchorComboBox_currentIndexChanged( int index );
1035  void penJoinStyleChanged();
1036  void updateAssistantSymbol();
1037 
1038  private:
1039 
1040  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1041 
1042  QFont mRefFont;
1043  QFontDatabase mFontDB;
1044 
1045 };
1046 
1048 
1049 
1050 #include "ui_widget_centroidfill.h"
1051 
1053 
1058 class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1059 {
1060  Q_OBJECT
1061 
1062  public:
1063 
1069  QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1070 
1076 
1077  // from base class
1078  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1079  QgsSymbolLayer *symbolLayer() override;
1080 
1081  protected:
1082  QgsCentroidFillSymbolLayer *mLayer = nullptr;
1083 
1084  private slots:
1085  void mDrawInsideCheckBox_stateChanged( int state );
1086  void mDrawAllPartsCheckBox_stateChanged( int state );
1087  void mClipPointsCheckBox_stateChanged( int state );
1088  void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1089 };
1090 
1091 
1092 #include "ui_qgsgeometrygeneratorwidgetbase.h"
1093 #include "qgis_gui.h"
1094 
1096 
1101 class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1102 {
1103  Q_OBJECT
1104 
1105  public:
1106 
1112  QgsGeometryGeneratorSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1113 
1118 
1119  // from base class
1120  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1121  QgsSymbolLayer *symbolLayer() override;
1122 
1123  private:
1124  QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1125 
1126  private slots:
1127  void updateExpression( const QString &string );
1128  void updateSymbolType();
1129 };
1130 
1131 #endif
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:370
QgsPointPatternFillSymbolLayer
Definition: qgsfillsymbollayer.h:1540
QgsSimpleLineSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleLineSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:144
QgsGradientFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsGradientFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:374
QgsSymbolLayerWidget::setSymbolLayer
virtual void setSymbolLayer(QgsSymbolLayer *layer)=0
QgsLinePatternFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsLinePatternFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:838
QgsFilledMarkerSymbolLayer
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
Definition: qgsmarkersymbollayer.h:427
QgsSymbolLayerWidget::vectorLayer
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
Definition: qgssymbollayerwidget.h:72
QgsSimpleFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:268
QgsSymbolLayerWidget::changed
void changed()
Should be emitted whenever configuration changes happened on this symbol layer configuration.
QgsMarkerLineSymbolLayerWidget
Definition: qgssymbollayerwidget.h:467
QgsSymbolLayerWidget::symbolLayer
virtual QgsSymbolLayer * symbolLayer()=0
QgsGradientFillSymbolLayer
Definition: qgsfillsymbollayer.h:205
QgsHashedLineSymbolLayer
Line symbol layer type which draws repeating line sections along a line feature.
Definition: qgslinesymbollayer.h:783
CharacterWidget
A widget for displaying characters available in a preset font, and allowing users to select an indivi...
Definition: characterwidget.h:70
QgsSimpleLineSymbolLayerWidget
Definition: qgssymbollayerwidget.h:128
QgsSymbolLayerWidget
Definition: qgssymbollayerwidget.h:35
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
QgsPointPatternFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsPointPatternFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:881
QgsRandomMarkerFillSymbolLayerWidget
Widget for controlling the properties of a QgsRandomMarkerFillSymbolLayer.
Definition: qgssymbollayerwidget.h:920
QgsSimpleMarkerSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleMarkerSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:207
QgsMarkerLineSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsMarkerLineSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:483
QgsRasterFillSymbolLayer
A class for filling symbols with a repeated raster image.
Definition: qgsfillsymbollayer.h:800
QgsSvgMarkerSymbolLayerWidget
Definition: qgssymbollayerwidget.h:577
QgsRandomMarkerFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRandomMarkerFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:936
QgsSvgMarkerSymbolLayerWidget::populateList
Q_DECL_DEPRECATED void populateList()
This method does nothing anymore, the loading is automatic.
Definition: qgssymbollayerwidget.h:613
QgsMarkerLineSymbolLayer
Line symbol layer type which draws repeating marker symbols along a line feature.
Definition: qgslinesymbollayer.h:694
qgssymbolwidgetcontext.h
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition: qgspropertyoverridebutton.h:51
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsSymbolLayerWidget::symbolChanged
void symbolChanged()
Should be emitted whenever the sub symbol changed on this symbol layer configuration.
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsCentroidFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsCentroidFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:1075
QgsRasterFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:715
QgsSymbolLayer
Definition: qgssymbollayer.h:53
QgsSvgMarkerSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSvgMarkerSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:593
QgsSymbolLayerWidget::setContext
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
Definition: qgssymbollayerwidget.cpp:118
QgsRasterFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:731
QgsFontMarkerSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFontMarkerSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:981
QgsSimpleLineSymbolLayer
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
Definition: qgslinesymbollayer.h:40
QgsHashedLineSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsHashedLineSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:538
QgsLinePatternFillSymbolLayer
A symbol fill consisting of repeated parallel lines.
Definition: qgsfillsymbollayer.h:1292
QgsSimpleMarkerSymbolLayer
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Definition: qgsmarkersymbollayer.h:199
QgsSvgMarkerSymbolLayer
Definition: qgsmarkersymbollayer.h:483
QgsGradientFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:358
qgis_sip.h
QgsGeometryGeneratorSymbolLayer
Definition: qgsgeometrygeneratorsymbollayer.h:27
QgsSVGFillSymbolLayer
A class for filling symbols with a repeated SVG file.
Definition: qgsfillsymbollayer.h:1025
QgsShapeburstFillSymbolLayer
Definition: qgsfillsymbollayer.h:416
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsRasterMarkerSymbolLayer
Raster marker symbol layer class.
Definition: qgsmarkersymbollayer.h:653
QgsRasterMarkerSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterMarkerSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:677
qgssymbollayer.h
QgsShapeburstFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:415
QgsGeometryGeneratorSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Will be registered as factory.
Definition: qgssymbollayerwidget.h:1117
QgsLinePatternFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:822
QgsCentroidFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:1059
QgsSVGFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSVGFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:781
QgsSimpleMarkerSymbolLayerWidget
Definition: qgssymbollayerwidget.h:191
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsShapeburstFillSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsShapeburstFillSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:431
QgsFontMarkerSymbolLayer
Definition: qgsmarkersymbollayer.h:803
QgsRandomMarkerFillSymbolLayer
A fill symbol layer which places markers at random locations within polygons.
Definition: qgsfillsymbollayer.h:1811
QgsSVGFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:765
QgsSimpleFillSymbolLayer
Definition: qgsfillsymbollayer.h:40
QgsFontMarkerSymbolLayerWidget
Definition: qgssymbollayerwidget.h:965
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:131
QgsGeometryGeneratorSymbolLayerWidget
Definition: qgssymbollayerwidget.h:1102
QgsCentroidFillSymbolLayer
Definition: qgsfillsymbollayer.h:2000
QgsPointPatternFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:865
QgsFilledMarkerSymbolLayerWidget::create
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFilledMarkerSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:321
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition: qgsexpressioncontextgenerator.h:37
MathUtils::angle
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
Definition: MathUtils.cpp:786
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QgsSimpleFillSymbolLayerWidget
Definition: qgssymbollayerwidget.h:252
QgsFilledMarkerSymbolLayerWidget
Widget for configuring QgsFilledMarkerSymbolLayer symbol layers.
Definition: qgssymbollayerwidget.h:305
qgspropertyoverridebutton.h
QgsRasterMarkerSymbolLayerWidget
Widget for configuring QgsRasterMarkerSymbolLayer symbol layers.
Definition: qgssymbollayerwidget.h:661
QgsSymbolLayerWidget::QgsSymbolLayerWidget
QgsSymbolLayerWidget(QWidget *parent, QgsVectorLayer *vl=nullptr)
Constructor for QgsSymbolLayerWidget.
Definition: qgssymbollayerwidget.h:45
QgsHashedLineSymbolLayerWidget
Widget for controlling the properties of a QgsHashedLineSymbolLayer.
Definition: qgssymbollayerwidget.h:522