QGIS API Documentation  3.21.0-Master (5b68dc587e)
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 
25 #include <QWidget>
26 #include <QStandardItemModel>
27 
28 class QgsVectorLayer;
29 class QgsMapCanvas;
30 class QgsMarkerSymbol;
31 class QgsLineSymbol;
32 
37 class GUI_EXPORT QgsSymbolLayerWidget : public QWidget, protected QgsExpressionContextGenerator
38 {
39  Q_OBJECT
40 
41  public:
42 
48  QgsSymbolLayerWidget( QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *vl = nullptr )
49  : QWidget( parent )
50  , mVectorLayer( vl )
51  {}
52 
53  virtual void setSymbolLayer( QgsSymbolLayer *layer ) = 0;
54  virtual QgsSymbolLayer *symbolLayer() = 0;
55 
62  virtual void setContext( const QgsSymbolWidgetContext &context );
63 
69  QgsSymbolWidgetContext context() const;
70 
75  const QgsVectorLayer *vectorLayer() const { return mVectorLayer; }
76 
77  protected:
78 
85  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
86 
88 
89  private:
90  QgsVectorLayer *mVectorLayer = nullptr;
91 
92  QgsMapCanvas *mMapCanvas = nullptr;
93 
94  signals:
95 
100  void changed();
101 
109 
110  protected slots:
111  void updateDataDefinedProperty();
112 
113  private slots:
114  void createAuxiliaryField();
115 
116  private:
117  QgsSymbolWidgetContext mContext;
118 };
119 
121 
122 #include "ui_widget_simpleline.h"
123 
125 
130 class GUI_EXPORT QgsSimpleLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleLine
131 {
132  Q_OBJECT
133 
134  public:
135 
141  QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
142 
144 
150 
151  // from base class
152  void setSymbolLayer( QgsSymbolLayer *layer ) override;
153  QgsSymbolLayer *symbolLayer() override;
154  void setContext( const QgsSymbolWidgetContext &context ) override;
155 
156  protected:
157  QgsSimpleLineSymbolLayer *mLayer = nullptr;
158 
159  //creates a new icon for the 'change pattern' button
160  void updatePatternIcon();
161 
162  void resizeEvent( QResizeEvent *event ) override;
163 
164  private slots:
165 
166  void updateAssistantSymbol();
167  void penWidthChanged();
168  void colorChanged( const QColor &color );
169  void penStyleChanged();
170  void offsetChanged();
171  void patternOffsetChanged();
172  void mCustomCheckBox_stateChanged( int state );
173  void mChangePatternButton_clicked();
174  void mPenWidthUnitWidget_changed();
175  void mOffsetUnitWidget_changed();
176  void mDashPatternUnitWidget_changed();
177  void mDrawInsideCheckBox_stateChanged( int state );
178  void patternOffsetUnitChanged();
179 
180  private:
181 
182  std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
183 
184 };
185 
187 
188 #include "ui_widget_simplemarker.h"
189 
191 
196 class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
197 {
198  Q_OBJECT
199 
200  public:
201 
207  QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
209 
215 
216  // from base class
217  void setSymbolLayer( QgsSymbolLayer *layer ) override;
218  QgsSymbolLayer *symbolLayer() override;
219 
220  public slots:
221 
222  void setColorStroke( const QColor &color );
223  void setColorFill( const QColor &color );
224 
225  protected:
226  QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
227 
228  private slots:
229  void setSize();
230  void setAngle();
231  void setOffset();
232  void mSizeUnitWidget_changed();
233  void mOffsetUnitWidget_changed();
234  void mStrokeWidthUnitWidget_changed();
235  void mStrokeStyleComboBox_currentIndexChanged( int index );
236  void mStrokeWidthSpinBox_valueChanged( double d );
237  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
238  void mVerticalAnchorComboBox_currentIndexChanged( int index );
239  void setShape();
240  void updateAssistantSymbol();
241  void penJoinStyleChanged();
242  void penCapStyleChanged();
243 
244  private:
245 
246  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
247 };
248 
250 
251 #include "ui_widget_simplefill.h"
252 
254 
259 class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
260 {
261  Q_OBJECT
262 
263  public:
264 
270  QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
271 
277 
278  // from base class
279  void setSymbolLayer( QgsSymbolLayer *layer ) override;
280  QgsSymbolLayer *symbolLayer() override;
281 
282  public slots:
283  void setColor( const QColor &color );
284  void setStrokeColor( const QColor &color );
285 
286  protected:
287  QgsSimpleFillSymbolLayer *mLayer = nullptr;
288 
289  private slots:
290  void setBrushStyle();
291  void strokeWidthChanged();
292  void strokeStyleChanged();
293  void offsetChanged();
294  void mStrokeWidthUnitWidget_changed();
295  void mOffsetUnitWidget_changed();
296 
297 };
298 
299 
301 
302 #include "ui_widget_filledmarker.h"
303 
305 
312 class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
313 {
314  Q_OBJECT
315 
316  public:
317 
323  QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
325 
331 
332  // from base class
333  void setSymbolLayer( QgsSymbolLayer *layer ) override;
334  QgsSymbolLayer *symbolLayer() override;
335 
336  protected:
337  QgsFilledMarkerSymbolLayer *mLayer = nullptr;
338 
339  private slots:
340 
341  void updateAssistantSymbol();
342  void setShape();
343  void setSize();
344  void setAngle();
345  void setOffset();
346  void mSizeUnitWidget_changed();
347  void mOffsetUnitWidget_changed();
348  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
349  void mVerticalAnchorComboBox_currentIndexChanged( int index );
350 
351  private:
352 
353  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
354 };
355 
357 
358 #include "ui_widget_gradientfill.h"
359 
361 
366 class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
367 {
368  Q_OBJECT
369 
370  public:
371 
377  QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
378 
384 
385  // from base class
386  void setSymbolLayer( QgsSymbolLayer *layer ) override;
387  QgsSymbolLayer *symbolLayer() override;
388 
389  public slots:
390  void setColor( const QColor &color );
391  void setColor2( const QColor &color );
392 
396  void applyColorRamp();
397  void setGradientType( int index );
398  void setCoordinateMode( int index );
399  void setGradientSpread( int index );
400 
401  protected:
402  QgsGradientFillSymbolLayer *mLayer = nullptr;
403 
404  private slots:
405  void offsetChanged();
406  void referencePointChanged();
407  void mOffsetUnitWidget_changed();
408  void colorModeChanged();
409  void mSpinAngle_valueChanged( double value );
410 
411 };
412 
414 
415 #include "ui_widget_shapeburstfill.h"
416 
418 
423 class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
424 {
425  Q_OBJECT
426 
427  public:
428 
434  QgsShapeburstFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
435 
441 
442  // from base class
443  void setSymbolLayer( QgsSymbolLayer *layer ) override;
444  QgsSymbolLayer *symbolLayer() override;
445 
446  public slots:
447  void setColor( const QColor &color );
448  void setColor2( const QColor &color );
449 
450  protected:
451  QgsShapeburstFillSymbolLayer *mLayer = nullptr;
452 
453  private slots:
454  void colorModeChanged();
455  void mSpinBlurRadius_valueChanged( int value );
456  void mSpinMaxDistance_valueChanged( double value );
457  void mDistanceUnitWidget_changed();
458  void mRadioUseWholeShape_toggled( bool value );
459  void applyColorRamp();
460  void offsetChanged();
461  void mOffsetUnitWidget_changed();
462  void mIgnoreRingsCheckBox_stateChanged( int state );
463 };
464 
466 
467 #include "ui_widget_markerline.h"
468 
470 
475 class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
476 {
477  Q_OBJECT
478 
479  public:
480 
486  QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
487 
493 
494  // from base class
495  void setSymbolLayer( QgsSymbolLayer *layer ) override;
496  QgsSymbolLayer *symbolLayer() override;
497  void setContext( const QgsSymbolWidgetContext &context ) override;
498 
499  public slots:
500 
501  void setInterval( double val );
502  void setOffsetAlongLine( double val );
503 
504  protected:
505 
506  QgsMarkerLineSymbolLayer *mLayer = nullptr;
507 
508  private slots:
509  void setRotate();
510  void setOffset();
511  void setPlacement();
512  void mIntervalUnitWidget_changed();
513  void mOffsetUnitWidget_changed();
514  void mOffsetAlongLineUnitWidget_changed();
515  void averageAngleUnitChanged();
516  void setAverageAngle( double val );
517 
518 };
519 
520 
521 #include "ui_widget_hashline.h"
522 
524 
531 class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
532 {
533  Q_OBJECT
534 
535  public:
536 
542  QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
543 
549 
550  // from base class
551  void setSymbolLayer( QgsSymbolLayer *layer ) override;
552  QgsSymbolLayer *symbolLayer() override;
553  void setContext( const QgsSymbolWidgetContext &context ) override;
554 
555  private slots:
556 
557  void setInterval( double val );
558  void setOffsetAlongLine( double val );
559  void setHashLength( double val );
560  void setHashAngle( double val );
561 
562  void setRotate();
563  void setOffset();
564  void setPlacement();
565  void mIntervalUnitWidget_changed();
566  void mOffsetUnitWidget_changed();
567  void mOffsetAlongLineUnitWidget_changed();
568  void hashLengthUnitWidgetChanged();
569  void averageAngleUnitChanged();
570  void setAverageAngle( double val );
571  private:
572  QgsHashedLineSymbolLayer *mLayer = nullptr;
573 
574 
575 };
576 
578 
579 #include "ui_widget_svgmarker.h"
580 
582 
587 class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
588 {
589  Q_OBJECT
590 
591  public:
592 
598  QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
600 
606 
607  // from base class
608  void setSymbolLayer( QgsSymbolLayer *layer ) override;
609  QgsSymbolLayer *symbolLayer() override;
610 
611  void setContext( const QgsSymbolWidgetContext &context ) override;
612 
613  public slots:
615  void setSvgPath( const QString &name );
617  void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
618 
619 
620  protected:
621  // TODO QGIS 4: remove
622 
627  Q_DECL_DEPRECATED void populateList() SIP_DEPRECATED {}
628 
635  void setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors = false );
636 
637  QgsSvgMarkerSymbolLayer *mLayer = nullptr;
638 
639  private slots:
640  void svgSourceChanged( const QString &text );
641  void mChangeColorButton_colorChanged( const QColor &color );
642  void mChangeStrokeColorButton_colorChanged( const QColor &color );
643  void mStrokeWidthSpinBox_valueChanged( double d );
644  void mSizeUnitWidget_changed();
645  void mStrokeWidthUnitWidget_changed();
646  void mOffsetUnitWidget_changed();
647  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
648  void mVerticalAnchorComboBox_currentIndexChanged( int index );
649  void setWidth();
650  void setHeight();
651  void lockAspectRatioChanged( bool locked );
652  void setAngle();
653  void setOffset();
654  void updateAssistantSymbol();
655 
656  private:
657 
658  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
659 
660 };
661 
663 
664 #include "ui_widget_rastermarker.h"
665 
667 
674 class GUI_EXPORT QgsRasterMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterMarker
675 {
676  Q_OBJECT
677 
678  public:
679 
685  QgsRasterMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
686 
692 
693  // from base class
694  void setSymbolLayer( QgsSymbolLayer *layer ) override;
695  QgsSymbolLayer *symbolLayer() override;
696  void setContext( const QgsSymbolWidgetContext &context ) override;
697 
698  protected:
699 
700  QgsRasterMarkerSymbolLayer *mLayer = nullptr;
701 
702  private slots:
703  void imageSourceChanged( const QString &text );
704  void mSizeUnitWidget_changed();
705  void mOffsetUnitWidget_changed();
706  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
707  void mVerticalAnchorComboBox_currentIndexChanged( int index );
708  void setWidth();
709  void setHeight();
710  void setLockAspectRatio( bool locked );
711  void setAngle();
712  void setOffset();
713  void setOpacity( double value );
714  void updatePreviewImage();
715 
716 };
717 
719 
720 #include "ui_widget_rasterfill.h"
721 
723 
728 class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
729 {
730  Q_OBJECT
731 
732  public:
733 
739  QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
740 
746 
747  // from base class
748  void setSymbolLayer( QgsSymbolLayer *layer ) override;
749  QgsSymbolLayer *symbolLayer() override;
750 
751  protected:
752  QgsRasterFillSymbolLayer *mLayer = nullptr;
753 
754  private slots:
755  void imageSourceChanged( const QString &text );
756  void setCoordinateMode( int index );
757  void opacityChanged( double value );
758  void offsetChanged();
759  void mOffsetUnitWidget_changed();
760  void mRotationSpinBox_valueChanged( double d );
761  void mWidthUnitWidget_changed();
762  void mWidthSpinBox_valueChanged( double d );
763 
764  private:
765  void updatePreviewImage();
766 };
767 
769 
770 #include "ui_widget_svgfill.h"
771 
773 
778 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
779 {
780  Q_OBJECT
781 
782  public:
783 
789  QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
790 
796 
797  // from base class
798  void setSymbolLayer( QgsSymbolLayer *layer ) override;
799  QgsSymbolLayer *symbolLayer() override;
800  void setContext( const QgsSymbolWidgetContext &context ) override;
801 
802  protected:
803  QgsSVGFillSymbolLayer *mLayer = nullptr;
804 
811  void updateParamGui( bool resetValues = true );
812 
813  private slots:
814  void mTextureWidthSpinBox_valueChanged( double d );
815  void svgSourceChanged( const QString &text );
816  void setFile( const QString &name );
817  void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
818  void mRotationSpinBox_valueChanged( double d );
819  void mChangeColorButton_colorChanged( const QColor &color );
820  void mChangeStrokeColorButton_colorChanged( const QColor &color );
821  void mStrokeWidthSpinBox_valueChanged( double d );
822  void mTextureWidthUnitWidget_changed();
823  void mSvgStrokeWidthUnitWidget_changed();
824 };
825 
827 
828 #include "ui_widget_linepatternfill.h"
829 
831 
836 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
837 {
838  Q_OBJECT
839 
840  public:
841 
847  QgsLinePatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
848 
854 
855  void setSymbolLayer( QgsSymbolLayer *layer ) override;
856  QgsSymbolLayer *symbolLayer() override;
857 
858  protected:
859  QgsLinePatternFillSymbolLayer *mLayer = nullptr;
860 
861  private slots:
862  void mAngleSpinBox_valueChanged( double d );
863  void mDistanceSpinBox_valueChanged( double d );
864  void mOffsetSpinBox_valueChanged( double d );
865  void mDistanceUnitWidget_changed();
866  void mOffsetUnitWidget_changed();
867 };
868 
870 
871 #include "ui_widget_pointpatternfill.h"
872 
874 
879 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
880 {
881  Q_OBJECT
882 
883  public:
884 
890  QgsPointPatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
891 
897 
898  void setSymbolLayer( QgsSymbolLayer *layer ) override;
899  QgsSymbolLayer *symbolLayer() override;
900 
901  protected:
903 
904  private slots:
905  void mHorizontalDistanceSpinBox_valueChanged( double d );
906  void mVerticalDistanceSpinBox_valueChanged( double d );
907  void mHorizontalDisplacementSpinBox_valueChanged( double d );
908  void mVerticalDisplacementSpinBox_valueChanged( double d );
909  void mHorizontalOffsetSpinBox_valueChanged( double d );
910  void mVerticalOffsetSpinBox_valueChanged( double d );
911  void mHorizontalDistanceUnitWidget_changed();
912  void mVerticalDistanceUnitWidget_changed();
913  void mHorizontalDisplacementUnitWidget_changed();
914  void mVerticalDisplacementUnitWidget_changed();
915  void mHorizontalOffsetUnitWidget_changed();
916  void mVerticalOffsetUnitWidget_changed();
917 };
918 
919 
921 
922 #include "ui_widget_randommarkerfill.h"
923 
925 
934 class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
935 {
936  Q_OBJECT
937 
938  public:
939 
945  QgsRandomMarkerFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
946 
952 
953  void setSymbolLayer( QgsSymbolLayer *layer ) override;
954  QgsSymbolLayer *symbolLayer() override;
955 
956  private:
957  QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
958 
959  private slots:
960 
961  void countMethodChanged( int );
962  void countChanged( int d );
963  void densityAreaChanged( double d );
964  void densityAreaUnitChanged();
965  void seedChanged( int d );
966 };
967 
969 
970 #include "ui_widget_fontmarker.h"
971 
973 class CharacterWidget;
974 
979 class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
980 {
981  Q_OBJECT
982 
983  public:
984 
990  QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
992 
998 
999  // from base class
1000  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1001  QgsSymbolLayer *symbolLayer() override;
1002 
1003  public slots:
1004  void setFontFamily( const QFont &font );
1005  void setColor( const QColor &color );
1006 
1011  void setColorStroke( const QColor &color );
1012  void setSize( double size );
1013  void setAngle( double angle );
1014 
1019  void setCharacter( QChar chr );
1020 
1026  void setCharacterFromText( const QString &text );
1027 
1028  protected:
1029  QgsFontMarkerSymbolLayer *mLayer = nullptr;
1030  CharacterWidget *widgetChar = nullptr;
1031 
1032  private slots:
1033 
1038  void setFontStyle( const QString &style );
1039 
1040  void setOffset();
1041  void mSizeUnitWidget_changed();
1042  void mOffsetUnitWidget_changed();
1043  void mStrokeWidthUnitWidget_changed();
1044  void mStrokeWidthSpinBox_valueChanged( double d );
1045 
1046  void populateFontStyleComboBox();
1047  void mFontStyleComboBox_currentIndexChanged( int index );
1048 
1049  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1050  void mVerticalAnchorComboBox_currentIndexChanged( int index );
1051  void penJoinStyleChanged();
1052  void updateAssistantSymbol();
1053 
1054  private:
1055 
1056  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1057 
1058  QFont mRefFont;
1059  QFontDatabase mFontDB;
1060 
1061 };
1062 
1064 
1065 
1066 #include "ui_widget_centroidfill.h"
1067 
1069 
1074 class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1075 {
1076  Q_OBJECT
1077 
1078  public:
1079 
1085  QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1086 
1092 
1093  // from base class
1094  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1095  QgsSymbolLayer *symbolLayer() override;
1096 
1097  protected:
1098  QgsCentroidFillSymbolLayer *mLayer = nullptr;
1099 
1100  private slots:
1101  void mDrawInsideCheckBox_stateChanged( int state );
1102  void mDrawAllPartsCheckBox_stateChanged( int state );
1103  void mClipPointsCheckBox_stateChanged( int state );
1104  void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1105 };
1106 
1107 
1108 #include "ui_qgsgeometrygeneratorwidgetbase.h"
1109 #include "qgis_gui.h"
1110 
1112 
1117 class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1118 {
1119  Q_OBJECT
1120 
1121  public:
1122 
1128  QgsGeometryGeneratorSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1129 
1134 
1135  // from base class
1136  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1137  QgsSymbolLayer *symbolLayer() override;
1138 
1139  private:
1140  QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1141  int mBlockSignals = 0;
1142 
1143  private slots:
1144  void updateExpression( const QString &string );
1145  void updateSymbolType();
1146 };
1147 
1148 #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.
~QgsFontMarkerSymbolLayerWidget() override
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.
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgslinesymbol.h:30
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:88
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsMarkerLineSymbolLayerWidget.
Line symbol layer type which draws repeating marker symbols along a line feature.
A marker symbol type, for rendering Point and MultiPoint geometries.
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.
~QgsSimpleLineSymbolLayerWidget() override
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.
~QgsSvgMarkerSymbolLayerWidget() override
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