QGIS API Documentation 3.37.0-Master (fa0c88a90b0)
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"
23#include "qgssymbollayer.h"
24
25#include <QWidget>
26#include <QStandardItemModel>
27
28class QgsVectorLayer;
29class QgsMapCanvas;
30class QgsMarkerSymbol;
31class QgsLineSymbol;
32
37class 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;
55
61 virtual void setContext( const QgsSymbolWidgetContext &context );
62
67 QgsSymbolWidgetContext context() const;
68
72 const QgsVectorLayer *vectorLayer() const { return mVectorLayer; }
73
74 protected:
75
81 void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
82
84
85 private:
86 QgsVectorLayer *mVectorLayer = nullptr;
87
88 QgsMapCanvas *mMapCanvas = nullptr;
89
90 signals:
91
96 void changed();
97
105
106 protected slots:
107 void updateDataDefinedProperty();
108
109 private slots:
110 void createAuxiliaryField();
111
112 private:
113 QgsSymbolWidgetContext mContext;
114};
115
117
118#include "ui_widget_simpleline.h"
119
121
126class GUI_EXPORT QgsSimpleLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleLine
127{
128 Q_OBJECT
129
130 public:
131
137 QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
138
140
146
147 // from base class
148 void setSymbolLayer( QgsSymbolLayer *layer ) override;
149 QgsSymbolLayer *symbolLayer() override;
150 void setContext( const QgsSymbolWidgetContext &context ) override;
151
152 protected:
153 QgsSimpleLineSymbolLayer *mLayer = nullptr;
154
155 //creates a new icon for the 'change pattern' button
156 void updatePatternIcon();
157
158 void resizeEvent( QResizeEvent *event ) override;
159
160 private slots:
161
162 void updateAssistantSymbol();
163 void penWidthChanged();
164 void colorChanged( const QColor &color );
165 void penStyleChanged();
166 void offsetChanged();
167 void patternOffsetChanged();
168 void mCustomCheckBox_stateChanged( int state );
169 void mChangePatternButton_clicked();
170 void mPenWidthUnitWidget_changed();
171 void mOffsetUnitWidget_changed();
172 void mDashPatternUnitWidget_changed();
173 void mDrawInsideCheckBox_stateChanged( int state );
174 void patternOffsetUnitChanged();
175
176 private:
177
178 std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
179
180};
181
183
184#include "ui_widget_simplemarker.h"
185
187
192class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
193{
194 Q_OBJECT
195
196 public:
197
203 QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
205
211
212 // from base class
213 void setSymbolLayer( QgsSymbolLayer *layer ) override;
214 QgsSymbolLayer *symbolLayer() override;
215
216 public slots:
217
218 void setColorStroke( const QColor &color );
219 void setColorFill( const QColor &color );
220
221 protected:
222 QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
223
224 private slots:
225 void setSize();
226 void setAngle();
227 void setOffset();
228 void mSizeUnitWidget_changed();
229 void mOffsetUnitWidget_changed();
230 void mStrokeWidthUnitWidget_changed();
231 void mStrokeStyleComboBox_currentIndexChanged( int index );
232 void mStrokeWidthSpinBox_valueChanged( double d );
233 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
234 void mVerticalAnchorComboBox_currentIndexChanged( int index );
235 void setShape();
236 void updateAssistantSymbol();
237 void penJoinStyleChanged();
238 void penCapStyleChanged();
239
240 private:
241
242 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
243};
244
246
247#include "ui_widget_simplefill.h"
248
250
255class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
256{
257 Q_OBJECT
258
259 public:
260
266 QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
267
273
274 // from base class
275 void setSymbolLayer( QgsSymbolLayer *layer ) override;
276 QgsSymbolLayer *symbolLayer() override;
277
278 public slots:
279 void setColor( const QColor &color );
280 void setStrokeColor( const QColor &color );
281
282 protected:
283 QgsSimpleFillSymbolLayer *mLayer = nullptr;
284
285 private slots:
286 void setBrushStyle();
287 void strokeWidthChanged();
288 void strokeStyleChanged();
289 void offsetChanged();
290 void mStrokeWidthUnitWidget_changed();
291 void mOffsetUnitWidget_changed();
292
293};
294
295
297
298#include "ui_widget_filledmarker.h"
299
301
307class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
308{
309 Q_OBJECT
310
311 public:
312
318 QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
320
326
327 // from base class
328 void setSymbolLayer( QgsSymbolLayer *layer ) override;
329 QgsSymbolLayer *symbolLayer() override;
330
331 protected:
332 QgsFilledMarkerSymbolLayer *mLayer = nullptr;
333
334 private slots:
335
336 void updateAssistantSymbol();
337 void setShape();
338 void setSize();
339 void setAngle();
340 void setOffset();
341 void mSizeUnitWidget_changed();
342 void mOffsetUnitWidget_changed();
343 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
344 void mVerticalAnchorComboBox_currentIndexChanged( int index );
345
346 private:
347
348 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
349};
350
352
353#include "ui_widget_gradientfill.h"
354
356
361class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
362{
363 Q_OBJECT
364
365 public:
366
372 QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
373
379
380 // from base class
381 void setSymbolLayer( QgsSymbolLayer *layer ) override;
382 QgsSymbolLayer *symbolLayer() override;
383
384 public slots:
385 void setColor( const QColor &color );
386 void setColor2( const QColor &color );
387
391 void applyColorRamp();
392 void setGradientType( int index );
393 void setCoordinateMode( int index );
394 void setGradientSpread( int index );
395
396 protected:
397 QgsGradientFillSymbolLayer *mLayer = nullptr;
398
399 private slots:
400 void offsetChanged();
401 void referencePointChanged();
402 void mOffsetUnitWidget_changed();
403 void colorModeChanged();
404 void mSpinAngle_valueChanged( double value );
405
406};
407
409
410#include "ui_widget_shapeburstfill.h"
411
413
418class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
419{
420 Q_OBJECT
421
422 public:
423
430
436
437 // from base class
438 void setSymbolLayer( QgsSymbolLayer *layer ) override;
439 QgsSymbolLayer *symbolLayer() override;
440
441 public slots:
442 void setColor( const QColor &color );
443 void setColor2( const QColor &color );
444
445 protected:
447
448 private slots:
449 void colorModeChanged();
450 void mSpinBlurRadius_valueChanged( int value );
451 void mSpinMaxDistance_valueChanged( double value );
452 void mDistanceUnitWidget_changed();
453 void mRadioUseWholeShape_toggled( bool value );
454 void applyColorRamp();
455 void offsetChanged();
456 void mOffsetUnitWidget_changed();
457 void mIgnoreRingsCheckBox_stateChanged( int state );
458};
459
461
462#include "ui_widget_markerline.h"
463
465
470class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
471{
472 Q_OBJECT
473
474 public:
475
481 QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
482
488
489 // from base class
490 void setSymbolLayer( QgsSymbolLayer *layer ) override;
491 QgsSymbolLayer *symbolLayer() override;
492 void setContext( const QgsSymbolWidgetContext &context ) override;
493
494 public slots:
495
496 void setInterval( double val );
497 void setOffsetAlongLine( double val );
498
499 protected:
500
501 QgsMarkerLineSymbolLayer *mLayer = nullptr;
502
503 private slots:
504 void setRotate();
505 void setOffset();
506 void setPlacement();
507 void mIntervalUnitWidget_changed();
508 void mOffsetUnitWidget_changed();
509 void mOffsetAlongLineUnitWidget_changed();
510 void averageAngleUnitChanged();
511 void setAverageAngle( double val );
512
513};
514
515
516#include "ui_widget_hashline.h"
517
519
526class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
527{
528 Q_OBJECT
529
530 public:
531
537 QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
538
544
545 // from base class
546 void setSymbolLayer( QgsSymbolLayer *layer ) override;
547 QgsSymbolLayer *symbolLayer() override;
548 void setContext( const QgsSymbolWidgetContext &context ) override;
549
550 private slots:
551
552 void setInterval( double val );
553 void setOffsetAlongLine( double val );
554 void setHashLength( double val );
555 void setHashAngle( double val );
556
557 void setRotate();
558 void setOffset();
559 void setPlacement();
560 void mIntervalUnitWidget_changed();
561 void mOffsetUnitWidget_changed();
562 void mOffsetAlongLineUnitWidget_changed();
563 void hashLengthUnitWidgetChanged();
564 void averageAngleUnitChanged();
565 void setAverageAngle( double val );
566 private:
567 QgsHashedLineSymbolLayer *mLayer = nullptr;
568
569
570};
571
573
574#include "ui_widget_svgmarker.h"
575
577
582class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
583{
584 Q_OBJECT
585
586 public:
587
593 QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
595
601
602 // from base class
603 void setSymbolLayer( QgsSymbolLayer *layer ) override;
604 QgsSymbolLayer *symbolLayer() override;
605
606 void setContext( const QgsSymbolWidgetContext &context ) override;
607
608 public slots:
610 void setSvgPath( const QString &name );
612 void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
613
614
615 protected:
616 // TODO QGIS 4: remove
617
622 Q_DECL_DEPRECATED void populateList() SIP_DEPRECATED {}
623
630 void setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors = false );
631
632 QgsSvgMarkerSymbolLayer *mLayer = nullptr;
633
634 private slots:
635 void svgSourceChanged( const QString &text );
636 void mChangeColorButton_colorChanged( const QColor &color );
637 void mChangeStrokeColorButton_colorChanged( const QColor &color );
638 void mStrokeWidthSpinBox_valueChanged( double d );
639 void mSizeUnitWidget_changed();
640 void mStrokeWidthUnitWidget_changed();
641 void mOffsetUnitWidget_changed();
642 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
643 void mVerticalAnchorComboBox_currentIndexChanged( int index );
644 void setWidth();
645 void setHeight();
646 void lockAspectRatioChanged( bool locked );
647 void setAngle();
648 void setOffset();
649 void updateAssistantSymbol();
650
651 private:
652
653 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
654
655};
656
658
659#include "ui_widget_rastermarker.h"
660
662
669class GUI_EXPORT QgsRasterMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterMarker
670{
671 Q_OBJECT
672
673 public:
674
680 QgsRasterMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
681
687
688 // from base class
689 void setSymbolLayer( QgsSymbolLayer *layer ) override;
690 QgsSymbolLayer *symbolLayer() override;
691 void setContext( const QgsSymbolWidgetContext &context ) override;
692
693 protected:
694
695 QgsRasterMarkerSymbolLayer *mLayer = nullptr;
696
697 private slots:
698 void imageSourceChanged( const QString &text );
699 void mSizeUnitWidget_changed();
700 void mOffsetUnitWidget_changed();
701 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
702 void mVerticalAnchorComboBox_currentIndexChanged( int index );
703 void setWidth();
704 void setHeight();
705 void setLockAspectRatio( bool locked );
706 void setAngle();
707 void setOffset();
708 void setOpacity( double value );
709 void updatePreviewImage();
710
711};
712
713
715
716#include "ui_widget_animatedmarker.h"
717
719
726class GUI_EXPORT QgsAnimatedMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetAnimatedMarker
727{
728 Q_OBJECT
729
730 public:
731
738
744
745 // from base class
746 void setSymbolLayer( QgsSymbolLayer *layer ) override;
747 QgsSymbolLayer *symbolLayer() override;
748 void setContext( const QgsSymbolWidgetContext &context ) override;
749
750 protected:
751
753
754 private slots:
755 void imageSourceChanged( const QString &text );
756 void mSizeUnitWidget_changed();
757 void mOffsetUnitWidget_changed();
758 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
759 void mVerticalAnchorComboBox_currentIndexChanged( int index );
760 void setWidth();
761 void setHeight();
762 void setLockAspectRatio( bool locked );
763 void setAngle();
764 void setOffset();
765 void setOpacity( double value );
766 void updatePreviewImage();
767
768 private:
769
770 QMovie *mPreviewMovie = nullptr;
771
772};
773
774
776
777#include "ui_widget_rasterfill.h"
778
780
785class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
786{
787 Q_OBJECT
788
789 public:
790
796 QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
797
803
804 // from base class
805 void setSymbolLayer( QgsSymbolLayer *layer ) override;
806 QgsSymbolLayer *symbolLayer() override;
807
808 protected:
809 QgsRasterFillSymbolLayer *mLayer = nullptr;
810
811 private slots:
812 void imageSourceChanged( const QString &text );
813 void setCoordinateMode( int index );
814 void opacityChanged( double value );
815 void offsetChanged();
816 void mOffsetUnitWidget_changed();
817 void mRotationSpinBox_valueChanged( double d );
818
819 private:
820 void updatePreviewImage();
821};
822
823
825
826#include "ui_widget_rasterline.h"
827
829
836class GUI_EXPORT QgsRasterLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterLine
837{
838 Q_OBJECT
839
840 public:
841
847 QgsRasterLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
848
854
855 // from base class
856 void setSymbolLayer( QgsSymbolLayer *layer ) override;
857 QgsSymbolLayer *symbolLayer() override;
858
859 protected:
860
861 QgsRasterLineSymbolLayer *mLayer = nullptr;
862
863 private slots:
864 void imageSourceChanged( const QString &text );
865 void updatePreviewImage();
866
867};
868
869
871
872#include "ui_widget_gradientline.h"
873
875
882class GUI_EXPORT QgsLineburstSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientLine
883{
884 Q_OBJECT
885
886 public:
887
893 QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
894
900
901 // from base class
902 void setSymbolLayer( QgsSymbolLayer *layer ) override;
903 QgsSymbolLayer *symbolLayer() override;
904
905 protected:
906
907 QgsLineburstSymbolLayer *mLayer = nullptr;
908
909};
910
911
913
914#include "ui_widget_filledline.h"
915
917
924class GUI_EXPORT QgsFilledLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledLine
925{
926 Q_OBJECT
927
928 public:
929
935 QgsFilledLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
936
938
944
945 void setSymbolLayer( QgsSymbolLayer *layer ) override;
946 QgsSymbolLayer *symbolLayer() override;
947
948 private:
949
950 QgsFilledLineSymbolLayer *mLayer = nullptr;
951
952};
953
954
956
957#include "ui_widget_svgfill.h"
958
960
965class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
966{
967 Q_OBJECT
968
969 public:
970
976 QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
977
983
984 // from base class
985 void setSymbolLayer( QgsSymbolLayer *layer ) override;
986 QgsSymbolLayer *symbolLayer() override;
987 void setContext( const QgsSymbolWidgetContext &context ) override;
988
989 protected:
990 QgsSVGFillSymbolLayer *mLayer = nullptr;
991
998 void updateParamGui( bool resetValues = true );
999
1000 private slots:
1001 void mTextureWidthSpinBox_valueChanged( double d );
1002 void svgSourceChanged( const QString &text );
1003 void setFile( const QString &name );
1004 void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
1005 void mRotationSpinBox_valueChanged( double d );
1006 void mChangeColorButton_colorChanged( const QColor &color );
1007 void mChangeStrokeColorButton_colorChanged( const QColor &color );
1008 void mStrokeWidthSpinBox_valueChanged( double d );
1009 void mTextureWidthUnitWidget_changed();
1010 void mSvgStrokeWidthUnitWidget_changed();
1011};
1012
1014
1015#include "ui_widget_linepatternfill.h"
1016
1018
1023class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
1024{
1025 Q_OBJECT
1026
1027 public:
1028
1035
1041
1042 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1043 QgsSymbolLayer *symbolLayer() override;
1044
1045 protected:
1047
1048 private slots:
1049 void mAngleSpinBox_valueChanged( double d );
1050 void mDistanceSpinBox_valueChanged( double d );
1051 void mOffsetSpinBox_valueChanged( double d );
1052 void mDistanceUnitWidget_changed();
1053 void mOffsetUnitWidget_changed();
1054};
1055
1057
1058#include "ui_widget_pointpatternfill.h"
1059
1061
1066class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
1067{
1068 Q_OBJECT
1069
1070 public:
1071
1078
1084
1085 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1086 QgsSymbolLayer *symbolLayer() override;
1087
1088 protected:
1090
1091 private slots:
1092 void mHorizontalDistanceSpinBox_valueChanged( double d );
1093 void mVerticalDistanceSpinBox_valueChanged( double d );
1094 void mHorizontalDisplacementSpinBox_valueChanged( double d );
1095 void mVerticalDisplacementSpinBox_valueChanged( double d );
1096 void mHorizontalOffsetSpinBox_valueChanged( double d );
1097 void mVerticalOffsetSpinBox_valueChanged( double d );
1098 void mHorizontalDistanceUnitWidget_changed();
1099 void mVerticalDistanceUnitWidget_changed();
1100 void mHorizontalDisplacementUnitWidget_changed();
1101 void mVerticalDisplacementUnitWidget_changed();
1102 void mHorizontalOffsetUnitWidget_changed();
1103 void mVerticalOffsetUnitWidget_changed();
1104};
1105
1106
1108
1109#include "ui_widget_randommarkerfill.h"
1110
1112
1121class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
1122{
1123 Q_OBJECT
1124
1125 public:
1126
1133
1139
1140 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1141 QgsSymbolLayer *symbolLayer() override;
1142
1143 private:
1144 QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
1145
1146 private slots:
1147
1148 void countMethodChanged( int );
1149 void countChanged( int d );
1150 void densityAreaChanged( double d );
1151 void densityAreaUnitChanged();
1152 void seedChanged( int d );
1153};
1154
1156
1157#include "ui_widget_fontmarker.h"
1158
1160class CharacterWidget;
1161
1166class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
1167{
1168 Q_OBJECT
1169
1170 public:
1171
1177 QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1179
1185
1186 // from base class
1187 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1188 QgsSymbolLayer *symbolLayer() override;
1189
1190 public slots:
1191 void setFontFamily( const QFont &font );
1192 void setColor( const QColor &color );
1193
1197 void setColorStroke( const QColor &color );
1198 void setSize( double size );
1199 void setAngle( double angle );
1200
1205 void setCharacter( QChar chr );
1206
1212 void setCharacterFromText( const QString &text );
1213
1214 protected:
1215 QgsFontMarkerSymbolLayer *mLayer = nullptr;
1216 CharacterWidget *widgetChar = nullptr;
1217
1218 private slots:
1219
1224 void setFontStyle( const QString &style );
1225
1226 void setOffset();
1227 void mSizeUnitWidget_changed();
1228 void mOffsetUnitWidget_changed();
1229 void mStrokeWidthUnitWidget_changed();
1230 void mStrokeWidthSpinBox_valueChanged( double d );
1231
1232 void populateFontStyleComboBox();
1233 void mFontStyleComboBox_currentIndexChanged( int index );
1234
1235 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1236 void mVerticalAnchorComboBox_currentIndexChanged( int index );
1237 void penJoinStyleChanged();
1238 void updateAssistantSymbol();
1239
1240 private:
1241
1242 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1243
1244 QFont mRefFont;
1245 QFontDatabase mFontDB;
1246
1247};
1248
1250
1251
1252#include "ui_widget_centroidfill.h"
1253
1255
1260class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1261{
1262 Q_OBJECT
1263
1264 public:
1265
1271 QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1272
1278
1279 // from base class
1280 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1281 QgsSymbolLayer *symbolLayer() override;
1282
1283 protected:
1285
1286 private slots:
1287 void mDrawInsideCheckBox_stateChanged( int state );
1288 void mDrawAllPartsCheckBox_stateChanged( int state );
1289 void mClipPointsCheckBox_stateChanged( int state );
1290 void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1291};
1292
1293
1294#include "ui_qgsgeometrygeneratorwidgetbase.h"
1295#include "qgis_gui.h"
1296
1298
1303class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1304{
1305 Q_OBJECT
1306
1307 public:
1308
1315
1320
1321 // from base class
1322 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1323 QgsSymbolLayer *symbolLayer() override;
1324
1325 private:
1326 QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1327 int mBlockSignals = 0;
1328
1329 private slots:
1330 void updateExpression( const QString &string );
1331 void updateSymbolType();
1332};
1333
1334#endif
A widget for displaying characters available in a preset font, and allowing users to select an indivi...
Widget for configuring QgsAnimatedMarkerSymbolLayer symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsAnimatedMarkerSymbolLayerWidget.
Animated marker symbol layer class.
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...
A widget for configuring QgsFilledLineSymbolLayer.
~QgsFilledLineSymbolLayerWidget() override
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFilledLineSymbolLayerWidget.
A line symbol layer type which fills a stroked line with a QgsFillSymbol.
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:92
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.
void symbolChanged()
Should be emitted whenever the sub symbol changed on this symbol layer configuration.
virtual QgsSymbolLayer * symbolLayer()=0
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
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:716
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_FACTORY
Definition: qgis_sip.h:76