QGIS API Documentation  3.19.0-Master (67c226385a)
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  void setContext( const QgsSymbolWidgetContext &context ) override;
150 
151  protected:
152  QgsSimpleLineSymbolLayer *mLayer = nullptr;
153 
154  //creates a new icon for the 'change pattern' button
155  void updatePatternIcon();
156 
157  void resizeEvent( QResizeEvent *event ) override;
158 
159  private slots:
160 
161  void updateAssistantSymbol();
162  void penWidthChanged();
163  void colorChanged( const QColor &color );
164  void penStyleChanged();
165  void offsetChanged();
166  void patternOffsetChanged();
167  void mCustomCheckBox_stateChanged( int state );
168  void mChangePatternButton_clicked();
169  void mPenWidthUnitWidget_changed();
170  void mOffsetUnitWidget_changed();
171  void mDashPatternUnitWidget_changed();
172  void mDrawInsideCheckBox_stateChanged( int state );
173  void patternOffsetUnitChanged();
174 
175  private:
176 
177  std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
178 
179 };
180 
182 
183 #include "ui_widget_simplemarker.h"
184 
186 
191 class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
192 {
193  Q_OBJECT
194 
195  public:
196 
202  QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
203 
209 
210  // from base class
211  void setSymbolLayer( QgsSymbolLayer *layer ) override;
212  QgsSymbolLayer *symbolLayer() override;
213 
214  public slots:
215 
216  void setColorStroke( const QColor &color );
217  void setColorFill( const QColor &color );
218 
219  protected:
220  QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
221 
222  private slots:
223  void setSize();
224  void setAngle();
225  void setOffset();
226  void mSizeUnitWidget_changed();
227  void mOffsetUnitWidget_changed();
228  void mStrokeWidthUnitWidget_changed();
229  void mStrokeStyleComboBox_currentIndexChanged( int index );
230  void mStrokeWidthSpinBox_valueChanged( double d );
231  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
232  void mVerticalAnchorComboBox_currentIndexChanged( int index );
233  void setShape();
234  void updateAssistantSymbol();
235  void penJoinStyleChanged();
236 
237  private:
238 
239  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
240 };
241 
243 
244 #include "ui_widget_simplefill.h"
245 
247 
252 class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
253 {
254  Q_OBJECT
255 
256  public:
257 
263  QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
264 
270 
271  // from base class
272  void setSymbolLayer( QgsSymbolLayer *layer ) override;
273  QgsSymbolLayer *symbolLayer() override;
274 
275  public slots:
276  void setColor( const QColor &color );
277  void setStrokeColor( const QColor &color );
278 
279  protected:
280  QgsSimpleFillSymbolLayer *mLayer = nullptr;
281 
282  private slots:
283  void setBrushStyle();
284  void strokeWidthChanged();
285  void strokeStyleChanged();
286  void offsetChanged();
287  void mStrokeWidthUnitWidget_changed();
288  void mOffsetUnitWidget_changed();
289 
290 };
291 
292 
294 
295 #include "ui_widget_filledmarker.h"
296 
298 
305 class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
306 {
307  Q_OBJECT
308 
309  public:
310 
316  QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
317 
323 
324  // from base class
325  void setSymbolLayer( QgsSymbolLayer *layer ) override;
326  QgsSymbolLayer *symbolLayer() override;
327 
328  protected:
329  QgsFilledMarkerSymbolLayer *mLayer = nullptr;
330 
331  private slots:
332 
333  void updateAssistantSymbol();
334  void setShape();
335  void setSize();
336  void setAngle();
337  void setOffset();
338  void mSizeUnitWidget_changed();
339  void mOffsetUnitWidget_changed();
340  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
341  void mVerticalAnchorComboBox_currentIndexChanged( int index );
342 
343  private:
344 
345  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
346 };
347 
349 
350 #include "ui_widget_gradientfill.h"
351 
353 
358 class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
359 {
360  Q_OBJECT
361 
362  public:
363 
369  QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
370 
376 
377  // from base class
378  void setSymbolLayer( QgsSymbolLayer *layer ) override;
379  QgsSymbolLayer *symbolLayer() override;
380 
381  public slots:
382  void setColor( const QColor &color );
383  void setColor2( const QColor &color );
384 
388  void applyColorRamp();
389  void setGradientType( int index );
390  void setCoordinateMode( int index );
391  void setGradientSpread( int index );
392 
393  protected:
394  QgsGradientFillSymbolLayer *mLayer = nullptr;
395 
396  private slots:
397  void offsetChanged();
398  void referencePointChanged();
399  void mOffsetUnitWidget_changed();
400  void colorModeChanged();
401  void mSpinAngle_valueChanged( double value );
402 
403 };
404 
406 
407 #include "ui_widget_shapeburstfill.h"
408 
410 
415 class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
416 {
417  Q_OBJECT
418 
419  public:
420 
426  QgsShapeburstFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
427 
433 
434  // from base class
435  void setSymbolLayer( QgsSymbolLayer *layer ) override;
436  QgsSymbolLayer *symbolLayer() override;
437 
438  public slots:
439  void setColor( const QColor &color );
440  void setColor2( const QColor &color );
441 
442  protected:
443  QgsShapeburstFillSymbolLayer *mLayer = nullptr;
444 
445  private slots:
446  void colorModeChanged();
447  void mSpinBlurRadius_valueChanged( int value );
448  void mSpinMaxDistance_valueChanged( double value );
449  void mDistanceUnitWidget_changed();
450  void mRadioUseWholeShape_toggled( bool value );
451  void applyColorRamp();
452  void offsetChanged();
453  void mOffsetUnitWidget_changed();
454  void mIgnoreRingsCheckBox_stateChanged( int state );
455 };
456 
458 
459 #include "ui_widget_markerline.h"
460 
462 
467 class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
468 {
469  Q_OBJECT
470 
471  public:
472 
478  QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
479 
485 
486  // from base class
487  void setSymbolLayer( QgsSymbolLayer *layer ) override;
488  QgsSymbolLayer *symbolLayer() override;
489  void setContext( const QgsSymbolWidgetContext &context ) override;
490 
491  public slots:
492 
493  void setInterval( double val );
494  void setOffsetAlongLine( double val );
495 
496  protected:
497 
498  QgsMarkerLineSymbolLayer *mLayer = nullptr;
499 
500  private slots:
501  void setRotate();
502  void setOffset();
503  void setPlacement();
504  void mIntervalUnitWidget_changed();
505  void mOffsetUnitWidget_changed();
506  void mOffsetAlongLineUnitWidget_changed();
507  void averageAngleUnitChanged();
508  void setAverageAngle( double val );
509 
510 };
511 
512 
513 #include "ui_widget_hashline.h"
514 
516 
523 class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
524 {
525  Q_OBJECT
526 
527  public:
528 
534  QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
535 
541 
542  // from base class
543  void setSymbolLayer( QgsSymbolLayer *layer ) override;
544  QgsSymbolLayer *symbolLayer() override;
545  void setContext( const QgsSymbolWidgetContext &context ) override;
546 
547  private slots:
548 
549  void setInterval( double val );
550  void setOffsetAlongLine( double val );
551  void setHashLength( double val );
552  void setHashAngle( double val );
553 
554  void setRotate();
555  void setOffset();
556  void setPlacement();
557  void mIntervalUnitWidget_changed();
558  void mOffsetUnitWidget_changed();
559  void mOffsetAlongLineUnitWidget_changed();
560  void hashLengthUnitWidgetChanged();
561  void averageAngleUnitChanged();
562  void setAverageAngle( double val );
563  private:
564  QgsHashedLineSymbolLayer *mLayer = nullptr;
565 
566 
567 };
568 
570 
571 #include "ui_widget_svgmarker.h"
572 
574 
579 class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
580 {
581  Q_OBJECT
582 
583  public:
584 
590  QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
591 
597 
598  // from base class
599  void setSymbolLayer( QgsSymbolLayer *layer ) override;
600  QgsSymbolLayer *symbolLayer() override;
601 
602  void setContext( const QgsSymbolWidgetContext &context ) override;
603 
604  public slots:
606  void setSvgPath( const QString &name );
608  void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
609 
610 
611  protected:
612  // TODO QGIS 4: remove
613 
618  Q_DECL_DEPRECATED void populateList() SIP_DEPRECATED {}
619 
626  void setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors = false );
627 
628  QgsSvgMarkerSymbolLayer *mLayer = nullptr;
629 
630  private slots:
631  void svgSourceChanged( const QString &text );
632  void mChangeColorButton_colorChanged( const QColor &color );
633  void mChangeStrokeColorButton_colorChanged( const QColor &color );
634  void mStrokeWidthSpinBox_valueChanged( double d );
635  void mSizeUnitWidget_changed();
636  void mStrokeWidthUnitWidget_changed();
637  void mOffsetUnitWidget_changed();
638  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
639  void mVerticalAnchorComboBox_currentIndexChanged( int index );
640  void setWidth();
641  void setHeight();
642  void lockAspectRatioChanged( bool locked );
643  void setAngle();
644  void setOffset();
645  void updateAssistantSymbol();
646 
647  private:
648 
649  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
650 
651 };
652 
654 
655 #include "ui_widget_rastermarker.h"
656 
658 
665 class GUI_EXPORT QgsRasterMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterMarker
666 {
667  Q_OBJECT
668 
669  public:
670 
676  QgsRasterMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
677 
683 
684  // from base class
685  void setSymbolLayer( QgsSymbolLayer *layer ) override;
686  QgsSymbolLayer *symbolLayer() override;
687  void setContext( const QgsSymbolWidgetContext &context ) override;
688 
689  protected:
690 
691  QgsRasterMarkerSymbolLayer *mLayer = nullptr;
692 
693  private slots:
694  void imageSourceChanged( const QString &text );
695  void mSizeUnitWidget_changed();
696  void mOffsetUnitWidget_changed();
697  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
698  void mVerticalAnchorComboBox_currentIndexChanged( int index );
699  void setWidth();
700  void setHeight();
701  void setLockAspectRatio( bool locked );
702  void setAngle();
703  void setOffset();
704  void setOpacity( double value );
705  void updatePreviewImage();
706 
707 };
708 
710 
711 #include "ui_widget_rasterfill.h"
712 
714 
719 class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
720 {
721  Q_OBJECT
722 
723  public:
724 
730  QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
731 
737 
738  // from base class
739  void setSymbolLayer( QgsSymbolLayer *layer ) override;
740  QgsSymbolLayer *symbolLayer() override;
741 
742  protected:
743  QgsRasterFillSymbolLayer *mLayer = nullptr;
744 
745  private slots:
746  void imageSourceChanged( const QString &text );
747  void setCoordinateMode( int index );
748  void opacityChanged( double value );
749  void offsetChanged();
750  void mOffsetUnitWidget_changed();
751  void mRotationSpinBox_valueChanged( double d );
752  void mWidthUnitWidget_changed();
753  void mWidthSpinBox_valueChanged( double d );
754 
755  private:
756  void updatePreviewImage();
757 };
758 
760 
761 #include "ui_widget_svgfill.h"
762 
764 
769 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
770 {
771  Q_OBJECT
772 
773  public:
774 
780  QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
781 
787 
788  // from base class
789  void setSymbolLayer( QgsSymbolLayer *layer ) override;
790  QgsSymbolLayer *symbolLayer() override;
791  void setContext( const QgsSymbolWidgetContext &context ) override;
792 
793  protected:
794  QgsSVGFillSymbolLayer *mLayer = nullptr;
795 
802  void updateParamGui( bool resetValues = true );
803 
804  private slots:
805  void mTextureWidthSpinBox_valueChanged( double d );
806  void svgSourceChanged( const QString &text );
807  void setFile( const QString &name );
808  void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
809  void mRotationSpinBox_valueChanged( double d );
810  void mChangeColorButton_colorChanged( const QColor &color );
811  void mChangeStrokeColorButton_colorChanged( const QColor &color );
812  void mStrokeWidthSpinBox_valueChanged( double d );
813  void mTextureWidthUnitWidget_changed();
814  void mSvgStrokeWidthUnitWidget_changed();
815 };
816 
818 
819 #include "ui_widget_linepatternfill.h"
820 
822 
827 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
828 {
829  Q_OBJECT
830 
831  public:
832 
838  QgsLinePatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
839 
845 
846  void setSymbolLayer( QgsSymbolLayer *layer ) override;
847  QgsSymbolLayer *symbolLayer() override;
848 
849  protected:
850  QgsLinePatternFillSymbolLayer *mLayer = nullptr;
851 
852  private slots:
853  void mAngleSpinBox_valueChanged( double d );
854  void mDistanceSpinBox_valueChanged( double d );
855  void mOffsetSpinBox_valueChanged( double d );
856  void mDistanceUnitWidget_changed();
857  void mOffsetUnitWidget_changed();
858 };
859 
861 
862 #include "ui_widget_pointpatternfill.h"
863 
865 
870 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
871 {
872  Q_OBJECT
873 
874  public:
875 
881  QgsPointPatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
882 
888 
889  void setSymbolLayer( QgsSymbolLayer *layer ) override;
890  QgsSymbolLayer *symbolLayer() override;
891 
892  protected:
894 
895  private slots:
896  void mHorizontalDistanceSpinBox_valueChanged( double d );
897  void mVerticalDistanceSpinBox_valueChanged( double d );
898  void mHorizontalDisplacementSpinBox_valueChanged( double d );
899  void mVerticalDisplacementSpinBox_valueChanged( double d );
900  void mHorizontalOffsetSpinBox_valueChanged( double d );
901  void mVerticalOffsetSpinBox_valueChanged( double d );
902  void mHorizontalDistanceUnitWidget_changed();
903  void mVerticalDistanceUnitWidget_changed();
904  void mHorizontalDisplacementUnitWidget_changed();
905  void mVerticalDisplacementUnitWidget_changed();
906  void mHorizontalOffsetUnitWidget_changed();
907  void mVerticalOffsetUnitWidget_changed();
908 };
909 
910 
912 
913 #include "ui_widget_randommarkerfill.h"
914 
916 
925 class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
926 {
927  Q_OBJECT
928 
929  public:
930 
936  QgsRandomMarkerFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
937 
943 
944  void setSymbolLayer( QgsSymbolLayer *layer ) override;
945  QgsSymbolLayer *symbolLayer() override;
946 
947  private:
948  QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
949 
950  private slots:
951 
952  void countMethodChanged( int );
953  void countChanged( int d );
954  void densityAreaChanged( double d );
955  void densityAreaUnitChanged();
956  void seedChanged( int d );
957 };
958 
960 
961 #include "ui_widget_fontmarker.h"
962 
964 class CharacterWidget;
965 
970 class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
971 {
972  Q_OBJECT
973 
974  public:
975 
981  QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
982 
988 
989  // from base class
990  void setSymbolLayer( QgsSymbolLayer *layer ) override;
991  QgsSymbolLayer *symbolLayer() override;
992 
993  public slots:
994  void setFontFamily( const QFont &font );
995  void setColor( const QColor &color );
996 
1001  void setColorStroke( const QColor &color );
1002  void setSize( double size );
1003  void setAngle( double angle );
1004 
1009  void setCharacter( QChar chr );
1010 
1016  void setCharacterFromText( const QString &text );
1017 
1018  protected:
1019  QgsFontMarkerSymbolLayer *mLayer = nullptr;
1020  CharacterWidget *widgetChar = nullptr;
1021 
1022  private slots:
1023 
1028  void setFontStyle( const QString &style );
1029 
1030  void setOffset();
1031  void mSizeUnitWidget_changed();
1032  void mOffsetUnitWidget_changed();
1033  void mStrokeWidthUnitWidget_changed();
1034  void mStrokeWidthSpinBox_valueChanged( double d );
1035 
1036  void populateFontStyleComboBox();
1037  void mFontStyleComboBox_currentIndexChanged( int index );
1038 
1039  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1040  void mVerticalAnchorComboBox_currentIndexChanged( int index );
1041  void penJoinStyleChanged();
1042  void updateAssistantSymbol();
1043 
1044  private:
1045 
1046  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1047 
1048  QFont mRefFont;
1049  QFontDatabase mFontDB;
1050 
1051 };
1052 
1054 
1055 
1056 #include "ui_widget_centroidfill.h"
1057 
1059 
1064 class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1065 {
1066  Q_OBJECT
1067 
1068  public:
1069 
1075  QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1076 
1082 
1083  // from base class
1084  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1085  QgsSymbolLayer *symbolLayer() override;
1086 
1087  protected:
1088  QgsCentroidFillSymbolLayer *mLayer = nullptr;
1089 
1090  private slots:
1091  void mDrawInsideCheckBox_stateChanged( int state );
1092  void mDrawAllPartsCheckBox_stateChanged( int state );
1093  void mClipPointsCheckBox_stateChanged( int state );
1094  void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1095 };
1096 
1097 
1098 #include "ui_qgsgeometrygeneratorwidgetbase.h"
1099 #include "qgis_gui.h"
1100 
1102 
1107 class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1108 {
1109  Q_OBJECT
1110 
1111  public:
1112 
1118  QgsGeometryGeneratorSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1119 
1124 
1125  // from base class
1126  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1127  QgsSymbolLayer *symbolLayer() override;
1128 
1129  private:
1130  QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1131 
1132  private slots:
1133  void updateExpression( const QString &string );
1134  void updateSymbolType();
1135 };
1136 
1137 #endif
A widget for displaying characters available in a preset font, and allowing users to select an indivi...
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsCentroidFillSymbolLayerWidget.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Widget for configuring QgsFilledMarkerSymbolLayer symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFilledMarkerSymbolLayerWidget.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFontMarkerSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Will be registered as factory.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsGradientFillSymbolLayerWidget.
Widget for controlling the properties of a QgsHashedLineSymbolLayer.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsHashedLineSymbolLayerWidget.
Line symbol layer type which draws repeating line sections along a line feature.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsLinePatternFillSymbolLayerWidget.
A symbol fill consisting of repeated parallel lines.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:86
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsMarkerLineSymbolLayerWidget.
Line symbol layer type which draws repeating marker symbols along a line feature.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsPointPatternFillSymbolLayerWidget.
A button for controlling property overrides which may apply to a widget.
Widget for controlling the properties of a QgsRandomMarkerFillSymbolLayer.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRandomMarkerFillSymbolLayerWidget.
A fill symbol layer which places markers at random locations within polygons.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterFillSymbolLayerWidget.
A class for filling symbols with a repeated raster image.
Widget for configuring QgsRasterMarkerSymbolLayer symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterMarkerSymbolLayerWidget.
Raster marker symbol layer class.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSVGFillSymbolLayerWidget.
A class for filling symbols with a repeated SVG file.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsShapeburstFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleLineSymbolLayerWidget.
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleMarkerSymbolLayerWidget.
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Q_DECL_DEPRECATED void populateList()
This method does nothing anymore, the loading is automatic.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSvgMarkerSymbolLayerWidget.
QgsSymbolLayerWidget(QWidget *parent, QgsVectorLayer *vl=nullptr)
Constructor for QgsSymbolLayerWidget.
virtual void setSymbolLayer(QgsSymbolLayer *layer)=0
void changed()
Should be emitted whenever configuration changes happened on this symbol layer configuration.
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
virtual QgsSymbolLayer * symbolLayer()=0
void symbolChanged()
Should be emitted whenever the sub symbol changed on this symbol layer configuration.
Property
Data definable properties.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Represents a vector layer which manages a vector based data sets.
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
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_FACTORY
Definition: qgis_sip.h:76