QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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 QgsMarkerSymbol;
30class QgsLineSymbol;
31
36class GUI_EXPORT QgsSymbolLayerWidget : public QWidget, protected QgsExpressionContextGenerator
37{
38 Q_OBJECT
39
40 public:
41
47 QgsSymbolLayerWidget( QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *vl = nullptr )
48 : QWidget( parent )
49 , mVectorLayer( vl )
50 {}
51
52 virtual void setSymbolLayer( QgsSymbolLayer *layer ) = 0;
54
60 virtual void setContext( const QgsSymbolWidgetContext &context );
61
66 QgsSymbolWidgetContext context() const;
67
71 const QgsVectorLayer *vectorLayer() const { return mVectorLayer; }
72
73 protected:
74
80 void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
81
83
84 private:
85 QgsVectorLayer *mVectorLayer = nullptr;
86
87 signals:
88
93 void changed();
94
102
103 protected slots:
104 void updateDataDefinedProperty();
105
106 private slots:
107 void createAuxiliaryField();
108
109 private:
110 QgsSymbolWidgetContext mContext;
111};
112
114
115#include "ui_widget_simpleline.h"
116
118
123class GUI_EXPORT QgsSimpleLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleLine
124{
125 Q_OBJECT
126
127 public:
128
134 QgsSimpleLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
135
137
143
144 void setSymbolLayer( QgsSymbolLayer *layer ) override;
145 QgsSymbolLayer *symbolLayer() override;
146 void setContext( const QgsSymbolWidgetContext &context ) override;
147
148 protected:
149 QgsSimpleLineSymbolLayer *mLayer = nullptr;
150
151 //creates a new icon for the 'change pattern' button
152 void updatePatternIcon();
153
154 void resizeEvent( QResizeEvent *event ) override;
155
156 private slots:
157
158 void updateAssistantSymbol();
159 void penWidthChanged();
160 void colorChanged( const QColor &color );
161 void penStyleChanged();
162 void offsetChanged();
163 void patternOffsetChanged();
164 void mCustomCheckBox_stateChanged( int state );
165 void mChangePatternButton_clicked();
166 void mPenWidthUnitWidget_changed();
167 void mOffsetUnitWidget_changed();
168 void mDashPatternUnitWidget_changed();
169 void mDrawInsideCheckBox_stateChanged( int state );
170 void patternOffsetUnitChanged();
171
172 private:
173
174 std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
175
176};
177
179
180#include "ui_widget_simplemarker.h"
181
183
188class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
189{
190 Q_OBJECT
191
192 public:
193
199 QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
201
207
208 // from base class
209 void setSymbolLayer( QgsSymbolLayer *layer ) override;
210 QgsSymbolLayer *symbolLayer() override;
211
212 public slots:
213
214 void setColorStroke( const QColor &color );
215 void setColorFill( const QColor &color );
216
217 protected:
218 QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
219
220 private slots:
221 void setSize();
222 void setAngle();
223 void setOffset();
224 void mSizeUnitWidget_changed();
225 void mOffsetUnitWidget_changed();
226 void mStrokeWidthUnitWidget_changed();
227 void mStrokeStyleComboBox_currentIndexChanged( int index );
228 void mStrokeWidthSpinBox_valueChanged( double d );
229 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
230 void mVerticalAnchorComboBox_currentIndexChanged( int index );
231 void setShape();
232 void updateAssistantSymbol();
233 void penJoinStyleChanged();
234 void penCapStyleChanged();
235
236 private:
237
238 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
239};
240
242
243#include "ui_widget_simplefill.h"
244
246
251class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
252{
253 Q_OBJECT
254
255 public:
256
262 QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
263
269
270 // from base class
271 void setSymbolLayer( QgsSymbolLayer *layer ) override;
272 QgsSymbolLayer *symbolLayer() override;
273
274 public slots:
275 void setColor( const QColor &color );
276 void setStrokeColor( const QColor &color );
277
278 protected:
279 QgsSimpleFillSymbolLayer *mLayer = nullptr;
280
281 private slots:
282 void setBrushStyle();
283 void strokeWidthChanged();
284 void strokeStyleChanged();
285 void offsetChanged();
286 void mStrokeWidthUnitWidget_changed();
287 void mOffsetUnitWidget_changed();
288
289};
290
291
293
294#include "ui_widget_filledmarker.h"
295
297
303class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
304{
305 Q_OBJECT
306
307 public:
308
314 QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
316
322
323 // from base class
324 void setSymbolLayer( QgsSymbolLayer *layer ) override;
325 QgsSymbolLayer *symbolLayer() override;
326
327 protected:
328 QgsFilledMarkerSymbolLayer *mLayer = nullptr;
329
330 private slots:
331
332 void updateAssistantSymbol();
333 void setShape();
334 void setSize();
335 void setAngle();
336 void setOffset();
337 void mSizeUnitWidget_changed();
338 void mOffsetUnitWidget_changed();
339 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
340 void mVerticalAnchorComboBox_currentIndexChanged( int index );
341
342 private:
343
344 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
345};
346
348
349#include "ui_widget_gradientfill.h"
350
352
357class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
358{
359 Q_OBJECT
360
361 public:
362
368 QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
369
375
376 // from base class
377 void setSymbolLayer( QgsSymbolLayer *layer ) override;
378 QgsSymbolLayer *symbolLayer() override;
379
380 public slots:
381 void setColor( const QColor &color );
382 void setColor2( const QColor &color );
383
387 void applyColorRamp();
388 void setGradientType( int index );
389 void setCoordinateMode( int index );
390 void setGradientSpread( int index );
391
392 protected:
393 QgsGradientFillSymbolLayer *mLayer = nullptr;
394
395 private slots:
396 void offsetChanged();
397 void referencePointChanged();
398 void mOffsetUnitWidget_changed();
399 void colorModeChanged();
400 void mSpinAngle_valueChanged( double value );
401
402};
403
405
406#include "ui_widget_shapeburstfill.h"
407
409
414class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
415{
416 Q_OBJECT
417
418 public:
419
426
432
433 // from base class
434 void setSymbolLayer( QgsSymbolLayer *layer ) override;
435 QgsSymbolLayer *symbolLayer() override;
436
437 public slots:
438 void setColor( const QColor &color );
439 void setColor2( const QColor &color );
440
441 protected:
443
444 private slots:
445 void colorModeChanged();
446 void mSpinBlurRadius_valueChanged( int value );
447 void mSpinMaxDistance_valueChanged( double value );
448 void mDistanceUnitWidget_changed();
449 void mRadioUseWholeShape_toggled( bool value );
450 void applyColorRamp();
451 void offsetChanged();
452 void mOffsetUnitWidget_changed();
453 void mIgnoreRingsCheckBox_stateChanged( int state );
454};
455
457
458#include "ui_widget_markerline.h"
459
461
466class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
467{
468 Q_OBJECT
469
470 public:
471
477 QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
478
484
485 // from base class
486 void setSymbolLayer( QgsSymbolLayer *layer ) override;
487 QgsSymbolLayer *symbolLayer() override;
488 void setContext( const QgsSymbolWidgetContext &context ) override;
489
490 public slots:
491
492 void setInterval( double val );
493 void setOffsetAlongLine( double val );
494
495 protected:
496
497 QgsMarkerLineSymbolLayer *mLayer = nullptr;
498
499 private slots:
500 void setRotate();
501 void setOffset();
502 void setPlacement();
503 void mIntervalUnitWidget_changed();
504 void mOffsetUnitWidget_changed();
505 void mOffsetAlongLineUnitWidget_changed();
506 void averageAngleUnitChanged();
507 void setAverageAngle( double val );
508
509};
510
511
512#include "ui_widget_hashline.h"
513
515
522class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
523{
524 Q_OBJECT
525
526 public:
527
533 QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
534
540
541 // from base class
542 void setSymbolLayer( QgsSymbolLayer *layer ) override;
543 QgsSymbolLayer *symbolLayer() override;
544 void setContext( const QgsSymbolWidgetContext &context ) override;
545
546 private slots:
547
548 void setInterval( double val );
549 void setOffsetAlongLine( double val );
550 void setHashLength( double val );
551 void setHashAngle( double val );
552
553 void setRotate();
554 void setOffset();
555 void setPlacement();
556 void mIntervalUnitWidget_changed();
557 void mOffsetUnitWidget_changed();
558 void mOffsetAlongLineUnitWidget_changed();
559 void hashLengthUnitWidgetChanged();
560 void averageAngleUnitChanged();
561 void setAverageAngle( double val );
562 private:
563 QgsHashedLineSymbolLayer *mLayer = nullptr;
564
565
566};
567
569
570#include "ui_widget_svgmarker.h"
571
573
578class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
579{
580 Q_OBJECT
581
582 public:
583
589 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
665class 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
709
711
712#include "ui_widget_animatedmarker.h"
713
715
722class GUI_EXPORT QgsAnimatedMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetAnimatedMarker
723{
724 Q_OBJECT
725
726 public:
727
734
740
741 // from base class
742 void setSymbolLayer( QgsSymbolLayer *layer ) override;
743 QgsSymbolLayer *symbolLayer() override;
744 void setContext( const QgsSymbolWidgetContext &context ) override;
745
746 protected:
747
749
750 private slots:
751 void imageSourceChanged( const QString &text );
752 void mSizeUnitWidget_changed();
753 void mOffsetUnitWidget_changed();
754 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
755 void mVerticalAnchorComboBox_currentIndexChanged( int index );
756 void setWidth();
757 void setHeight();
758 void setLockAspectRatio( bool locked );
759 void setAngle();
760 void setOffset();
761 void setOpacity( double value );
762 void updatePreviewImage();
763
764 private:
765
766 QMovie *mPreviewMovie = nullptr;
767
768};
769
770
772
773#include "ui_widget_rasterfill.h"
774
776
781class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
782{
783 Q_OBJECT
784
785 public:
786
792 QgsRasterFillSymbolLayerWidget( 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 QgsRasterFillSymbolLayer *mLayer = nullptr;
806
807 private slots:
808 void imageSourceChanged( const QString &text );
809 void setCoordinateMode( int index );
810 void opacityChanged( double value );
811 void offsetChanged();
812 void mOffsetUnitWidget_changed();
813 void mRotationSpinBox_valueChanged( double d );
814
815 private:
816 void updatePreviewImage();
817};
818
819
821
822#include "ui_widget_rasterline.h"
823
825
832class GUI_EXPORT QgsRasterLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterLine
833{
834 Q_OBJECT
835
836 public:
837
843 QgsRasterLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
844
850
851 // from base class
852 void setSymbolLayer( QgsSymbolLayer *layer ) override;
853 QgsSymbolLayer *symbolLayer() override;
854
855 protected:
856
857 QgsRasterLineSymbolLayer *mLayer = nullptr;
858
859 private slots:
860 void imageSourceChanged( const QString &text );
861 void updatePreviewImage();
862
863};
864
865
867
868#include "ui_widget_gradientline.h"
869
871
878class GUI_EXPORT QgsLineburstSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientLine
879{
880 Q_OBJECT
881
882 public:
883
889 QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
890
896
897 // from base class
898 void setSymbolLayer( QgsSymbolLayer *layer ) override;
899 QgsSymbolLayer *symbolLayer() override;
900
901 protected:
902
903 QgsLineburstSymbolLayer *mLayer = nullptr;
904
905};
906
907
909
910#include "ui_widget_filledline.h"
911
913
920class GUI_EXPORT QgsFilledLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledLine
921{
922 Q_OBJECT
923
924 public:
925
931 QgsFilledLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
932
934
940
941 void setSymbolLayer( QgsSymbolLayer *layer ) override;
942 QgsSymbolLayer *symbolLayer() override;
943
944 private:
945
946 QgsFilledLineSymbolLayer *mLayer = nullptr;
947
948};
949
950
952
953#include "ui_widget_svgfill.h"
954
956
961class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
962{
963 Q_OBJECT
964
965 public:
966
972 QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
973
979
980 // from base class
981 void setSymbolLayer( QgsSymbolLayer *layer ) override;
982 QgsSymbolLayer *symbolLayer() override;
983 void setContext( const QgsSymbolWidgetContext &context ) override;
984
985 protected:
986 QgsSVGFillSymbolLayer *mLayer = nullptr;
987
994 void updateParamGui( bool resetValues = true );
995
996 private slots:
997 void mTextureWidthSpinBox_valueChanged( double d );
998 void svgSourceChanged( const QString &text );
999 void setFile( const QString &name );
1000 void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
1001 void mRotationSpinBox_valueChanged( double d );
1002 void mChangeColorButton_colorChanged( const QColor &color );
1003 void mChangeStrokeColorButton_colorChanged( const QColor &color );
1004 void mStrokeWidthSpinBox_valueChanged( double d );
1005 void mTextureWidthUnitWidget_changed();
1006 void mSvgStrokeWidthUnitWidget_changed();
1007};
1008
1010
1011#include "ui_widget_linepatternfill.h"
1012
1014
1019class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
1020{
1021 Q_OBJECT
1022
1023 public:
1024
1031
1037
1038 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1039 QgsSymbolLayer *symbolLayer() override;
1040
1041 protected:
1043
1044 private slots:
1045 void mAngleSpinBox_valueChanged( double d );
1046 void mDistanceSpinBox_valueChanged( double d );
1047 void mOffsetSpinBox_valueChanged( double d );
1048 void mDistanceUnitWidget_changed();
1049 void mOffsetUnitWidget_changed();
1050};
1051
1053
1054#include "ui_widget_pointpatternfill.h"
1055
1057
1062class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
1063{
1064 Q_OBJECT
1065
1066 public:
1067
1074
1080
1081 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1082 QgsSymbolLayer *symbolLayer() override;
1083
1084 protected:
1086
1087 private slots:
1088 void mHorizontalDistanceSpinBox_valueChanged( double d );
1089 void mVerticalDistanceSpinBox_valueChanged( double d );
1090 void mHorizontalDisplacementSpinBox_valueChanged( double d );
1091 void mVerticalDisplacementSpinBox_valueChanged( double d );
1092 void mHorizontalOffsetSpinBox_valueChanged( double d );
1093 void mVerticalOffsetSpinBox_valueChanged( double d );
1094 void mHorizontalDistanceUnitWidget_changed();
1095 void mVerticalDistanceUnitWidget_changed();
1096 void mHorizontalDisplacementUnitWidget_changed();
1097 void mVerticalDisplacementUnitWidget_changed();
1098 void mHorizontalOffsetUnitWidget_changed();
1099 void mVerticalOffsetUnitWidget_changed();
1100};
1101
1102
1104
1105#include "ui_widget_randommarkerfill.h"
1106
1108
1117class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
1118{
1119 Q_OBJECT
1120
1121 public:
1122
1129
1135
1136 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1137 QgsSymbolLayer *symbolLayer() override;
1138
1139 private:
1140 QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
1141
1142 private slots:
1143
1144 void countMethodChanged( int );
1145 void countChanged( int d );
1146 void densityAreaChanged( double d );
1147 void densityAreaUnitChanged();
1148 void seedChanged( int d );
1149};
1150
1152
1153#include "ui_widget_fontmarker.h"
1154
1156class CharacterWidget;
1157
1162class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
1163{
1164 Q_OBJECT
1165
1166 public:
1167
1173 QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1175
1181
1182 // from base class
1183 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1184 QgsSymbolLayer *symbolLayer() override;
1185
1186 public slots:
1187 void setFontFamily( const QFont &font );
1188 void setColor( const QColor &color );
1189
1193 void setColorStroke( const QColor &color );
1194 void setSize( double size );
1195 void setAngle( double angle );
1196
1201 void setCharacter( QChar chr );
1202
1208 void setCharacterFromText( const QString &text );
1209
1210 protected:
1211 QgsFontMarkerSymbolLayer *mLayer = nullptr;
1212 CharacterWidget *widgetChar = nullptr;
1213
1214 private slots:
1215
1220 void setFontStyle( const QString &style );
1221
1222 void setOffset();
1223 void mSizeUnitWidget_changed();
1224 void mOffsetUnitWidget_changed();
1225 void mStrokeWidthUnitWidget_changed();
1226 void mStrokeWidthSpinBox_valueChanged( double d );
1227
1228 void populateFontStyleComboBox();
1229 void mFontStyleComboBox_currentIndexChanged( int index );
1230
1231 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1232 void mVerticalAnchorComboBox_currentIndexChanged( int index );
1233 void penJoinStyleChanged();
1234 void updateAssistantSymbol();
1235
1236 private:
1237
1238 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1239
1240 QFont mRefFont;
1241 QFontDatabase mFontDB;
1242
1243};
1244
1246
1247
1248#include "ui_widget_centroidfill.h"
1249
1251
1256class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1257{
1258 Q_OBJECT
1259
1260 public:
1261
1267 QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1268
1274
1275 // from base class
1276 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1277 QgsSymbolLayer *symbolLayer() override;
1278
1279 protected:
1281
1282 private slots:
1283 void mDrawInsideCheckBox_stateChanged( int state );
1284 void mDrawAllPartsCheckBox_stateChanged( int state );
1285 void mClipPointsCheckBox_stateChanged( int state );
1286 void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1287};
1288
1289
1291
1292#include "ui_qgslinearreferencingsymbollayerwidgetbase.h"
1293
1295
1302class GUI_EXPORT QgsLinearReferencingSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::QgsLinearReferencingSymbolLayerWidgetBase
1303{
1304 Q_OBJECT
1305
1306 public:
1307
1312
1314
1320
1321 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1322 QgsSymbolLayer *symbolLayer() override;
1323 void setContext( const QgsSymbolWidgetContext &context ) override;
1324
1325 private slots:
1326 void changeNumberFormat();
1327
1328 private:
1329
1330 QgsLinearReferencingSymbolLayer *mLayer = nullptr;
1331 bool mBlockChangesSignal = false;
1332};
1333
1334
1335#include "ui_qgsgeometrygeneratorwidgetbase.h"
1336#include "qgis_gui.h"
1337
1339
1344class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1345{
1346 Q_OBJECT
1347
1348 public:
1349
1356
1361
1362 // from base class
1363 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1364 QgsSymbolLayer *symbolLayer() override;
1365
1366 private:
1367 QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1368 int mBlockSignals = 0;
1369
1370 private slots:
1371 void updateExpression( const QString &string );
1372 void updateSymbolType();
1373};
1374
1375#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.
A fill symbol layer which renders a marker symbol at the centroid of a polygon geometry.
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.
A symbol layer subclass which alters rendered feature shapes through the use of QGIS expressions.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsGradientFillSymbolLayerWidget.
A fill symbol layer which draws a smooth color gradient over a polygon.
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.
Widget for controlling the properties of a QgsLinearReferencingSymbolLayer.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsLinearReferencingSymbolLayerWidget.
Line symbol layer used for decorating accordingly to linear referencing.
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.
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.
Renders polygons using a single fill and stroke color.
~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.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_FACTORY
Definition qgis_sip.h:76