QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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 
768 
770 
771 #include "ui_widget_rasterline.h"
772 
774 
781 class GUI_EXPORT QgsRasterLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterLine
782 {
783  Q_OBJECT
784 
785  public:
786 
792  QgsRasterLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
793 
799 
800  // from base class
801  void setSymbolLayer( QgsSymbolLayer *layer ) override;
802  QgsSymbolLayer *symbolLayer() override;
803 
804  protected:
805 
806  QgsRasterLineSymbolLayer *mLayer = nullptr;
807 
808  private slots:
809  void imageSourceChanged( const QString &text );
810  void updatePreviewImage();
811 
812 };
813 
814 
816 
817 #include "ui_widget_gradientline.h"
818 
820 
827 class GUI_EXPORT QgsLineburstSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientLine
828 {
829  Q_OBJECT
830 
831  public:
832 
838  QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
839 
845 
846  // from base class
847  void setSymbolLayer( QgsSymbolLayer *layer ) override;
848  QgsSymbolLayer *symbolLayer() override;
849 
850  protected:
851 
852  QgsLineburstSymbolLayer *mLayer = nullptr;
853 
854 };
855 
857 
858 #include "ui_widget_svgfill.h"
859 
861 
866 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
867 {
868  Q_OBJECT
869 
870  public:
871 
877  QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
878 
884 
885  // from base class
886  void setSymbolLayer( QgsSymbolLayer *layer ) override;
887  QgsSymbolLayer *symbolLayer() override;
888  void setContext( const QgsSymbolWidgetContext &context ) override;
889 
890  protected:
891  QgsSVGFillSymbolLayer *mLayer = nullptr;
892 
899  void updateParamGui( bool resetValues = true );
900 
901  private slots:
902  void mTextureWidthSpinBox_valueChanged( double d );
903  void svgSourceChanged( const QString &text );
904  void setFile( const QString &name );
905  void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
906  void mRotationSpinBox_valueChanged( double d );
907  void mChangeColorButton_colorChanged( const QColor &color );
908  void mChangeStrokeColorButton_colorChanged( const QColor &color );
909  void mStrokeWidthSpinBox_valueChanged( double d );
910  void mTextureWidthUnitWidget_changed();
911  void mSvgStrokeWidthUnitWidget_changed();
912 };
913 
915 
916 #include "ui_widget_linepatternfill.h"
917 
919 
924 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
925 {
926  Q_OBJECT
927 
928  public:
929 
935  QgsLinePatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
936 
942 
943  void setSymbolLayer( QgsSymbolLayer *layer ) override;
944  QgsSymbolLayer *symbolLayer() override;
945 
946  protected:
947  QgsLinePatternFillSymbolLayer *mLayer = nullptr;
948 
949  private slots:
950  void mAngleSpinBox_valueChanged( double d );
951  void mDistanceSpinBox_valueChanged( double d );
952  void mOffsetSpinBox_valueChanged( double d );
953  void mDistanceUnitWidget_changed();
954  void mOffsetUnitWidget_changed();
955 };
956 
958 
959 #include "ui_widget_pointpatternfill.h"
960 
962 
967 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
968 {
969  Q_OBJECT
970 
971  public:
972 
978  QgsPointPatternFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
979 
985 
986  void setSymbolLayer( QgsSymbolLayer *layer ) override;
987  QgsSymbolLayer *symbolLayer() override;
988 
989  protected:
991 
992  private slots:
993  void mHorizontalDistanceSpinBox_valueChanged( double d );
994  void mVerticalDistanceSpinBox_valueChanged( double d );
995  void mHorizontalDisplacementSpinBox_valueChanged( double d );
996  void mVerticalDisplacementSpinBox_valueChanged( double d );
997  void mHorizontalOffsetSpinBox_valueChanged( double d );
998  void mVerticalOffsetSpinBox_valueChanged( double d );
999  void mHorizontalDistanceUnitWidget_changed();
1000  void mVerticalDistanceUnitWidget_changed();
1001  void mHorizontalDisplacementUnitWidget_changed();
1002  void mVerticalDisplacementUnitWidget_changed();
1003  void mHorizontalOffsetUnitWidget_changed();
1004  void mVerticalOffsetUnitWidget_changed();
1005 };
1006 
1007 
1009 
1010 #include "ui_widget_randommarkerfill.h"
1011 
1013 
1022 class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
1023 {
1024  Q_OBJECT
1025 
1026  public:
1027 
1033  QgsRandomMarkerFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1034 
1040 
1041  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1042  QgsSymbolLayer *symbolLayer() override;
1043 
1044  private:
1045  QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
1046 
1047  private slots:
1048 
1049  void countMethodChanged( int );
1050  void countChanged( int d );
1051  void densityAreaChanged( double d );
1052  void densityAreaUnitChanged();
1053  void seedChanged( int d );
1054 };
1055 
1057 
1058 #include "ui_widget_fontmarker.h"
1059 
1061 class CharacterWidget;
1062 
1067 class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
1068 {
1069  Q_OBJECT
1070 
1071  public:
1072 
1078  QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1080 
1086 
1087  // from base class
1088  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1089  QgsSymbolLayer *symbolLayer() override;
1090 
1091  public slots:
1092  void setFontFamily( const QFont &font );
1093  void setColor( const QColor &color );
1094 
1099  void setColorStroke( const QColor &color );
1100  void setSize( double size );
1101  void setAngle( double angle );
1102 
1107  void setCharacter( QChar chr );
1108 
1114  void setCharacterFromText( const QString &text );
1115 
1116  protected:
1117  QgsFontMarkerSymbolLayer *mLayer = nullptr;
1118  CharacterWidget *widgetChar = nullptr;
1119 
1120  private slots:
1121 
1126  void setFontStyle( const QString &style );
1127 
1128  void setOffset();
1129  void mSizeUnitWidget_changed();
1130  void mOffsetUnitWidget_changed();
1131  void mStrokeWidthUnitWidget_changed();
1132  void mStrokeWidthSpinBox_valueChanged( double d );
1133 
1134  void populateFontStyleComboBox();
1135  void mFontStyleComboBox_currentIndexChanged( int index );
1136 
1137  void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1138  void mVerticalAnchorComboBox_currentIndexChanged( int index );
1139  void penJoinStyleChanged();
1140  void updateAssistantSymbol();
1141 
1142  private:
1143 
1144  std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1145 
1146  QFont mRefFont;
1147  QFontDatabase mFontDB;
1148 
1149 };
1150 
1152 
1153 
1154 #include "ui_widget_centroidfill.h"
1155 
1157 
1162 class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1163 {
1164  Q_OBJECT
1165 
1166  public:
1167 
1173  QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1174 
1180 
1181  // from base class
1182  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1183  QgsSymbolLayer *symbolLayer() override;
1184 
1185  protected:
1186  QgsCentroidFillSymbolLayer *mLayer = nullptr;
1187 
1188  private slots:
1189  void mDrawInsideCheckBox_stateChanged( int state );
1190  void mDrawAllPartsCheckBox_stateChanged( int state );
1191  void mClipPointsCheckBox_stateChanged( int state );
1192  void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1193 };
1194 
1195 
1196 #include "ui_qgsgeometrygeneratorwidgetbase.h"
1197 #include "qgis_gui.h"
1198 
1200 
1205 class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1206 {
1207  Q_OBJECT
1208 
1209  public:
1210 
1216  QgsGeometryGeneratorSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1217 
1222 
1223  // from base class
1224  void setSymbolLayer( QgsSymbolLayer *layer ) override;
1225  QgsSymbolLayer *symbolLayer() override;
1226 
1227  private:
1228  QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1229  int mBlockSignals = 0;
1230 
1231  private slots:
1232  void updateExpression( const QString &string );
1233  void updateSymbolType();
1234 };
1235 
1236 #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
Widget for configuring QgsLineburstSymbolLayer symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsLineburstSymbolLayerWidget.
Line symbol layer type which draws a gradient pattern perpendicularly along a line.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
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 fill symbol layer which fills polygon shapes with repeating marker symbols.
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 QgsRasterLineSymbolLayer symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterLineSymbolLayerWidget.
Line symbol layer type which draws line sections using a raster image file.
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