QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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 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 void setSymbolLayer( QgsSymbolLayer *layer ) override;
148 QgsSymbolLayer *symbolLayer() override;
149 void setContext( const QgsSymbolWidgetContext &context ) override;
150
151 protected:
152 QgsSimpleLineSymbolLayer *mLayer = nullptr;
153
154 //creates a new icon for the 'change pattern' button
155 void updatePatternIcon();
156
157 void resizeEvent( QResizeEvent *event ) override;
158
159 private slots:
160
161 void updateAssistantSymbol();
162 void penWidthChanged();
163 void colorChanged( const QColor &color );
164 void penStyleChanged();
165 void offsetChanged();
166 void patternOffsetChanged();
167 void mCustomCheckBox_stateChanged( int state );
168 void mChangePatternButton_clicked();
169 void mPenWidthUnitWidget_changed();
170 void mOffsetUnitWidget_changed();
171 void mDashPatternUnitWidget_changed();
172 void mDrawInsideCheckBox_stateChanged( int state );
173 void patternOffsetUnitChanged();
174
175 private:
176
177 std::shared_ptr< QgsLineSymbol > mAssistantPreviewSymbol;
178
179};
180
182
183#include "ui_widget_simplemarker.h"
184
186
191class GUI_EXPORT QgsSimpleMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleMarker
192{
193 Q_OBJECT
194
195 public:
196
202 QgsSimpleMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
204
210
211 // from base class
212 void setSymbolLayer( QgsSymbolLayer *layer ) override;
213 QgsSymbolLayer *symbolLayer() override;
214
215 public slots:
216
217 void setColorStroke( const QColor &color );
218 void setColorFill( const QColor &color );
219
220 protected:
221 QgsSimpleMarkerSymbolLayer *mLayer = nullptr;
222
223 private slots:
224 void setSize();
225 void setAngle();
226 void setOffset();
227 void mSizeUnitWidget_changed();
228 void mOffsetUnitWidget_changed();
229 void mStrokeWidthUnitWidget_changed();
230 void mStrokeStyleComboBox_currentIndexChanged( int index );
231 void mStrokeWidthSpinBox_valueChanged( double d );
232 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
233 void mVerticalAnchorComboBox_currentIndexChanged( int index );
234 void setShape();
235 void updateAssistantSymbol();
236 void penJoinStyleChanged();
237 void penCapStyleChanged();
238
239 private:
240
241 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
242};
243
245
246#include "ui_widget_simplefill.h"
247
249
254class GUI_EXPORT QgsSimpleFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSimpleFill
255{
256 Q_OBJECT
257
258 public:
259
265 QgsSimpleFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
266
272
273 // from base class
274 void setSymbolLayer( QgsSymbolLayer *layer ) override;
275 QgsSymbolLayer *symbolLayer() override;
276
277 public slots:
278 void setColor( const QColor &color );
279 void setStrokeColor( const QColor &color );
280
281 protected:
282 QgsSimpleFillSymbolLayer *mLayer = nullptr;
283
284 private slots:
285 void setBrushStyle();
286 void strokeWidthChanged();
287 void strokeStyleChanged();
288 void offsetChanged();
289 void mStrokeWidthUnitWidget_changed();
290 void mOffsetUnitWidget_changed();
291
292};
293
294
296
297#include "ui_widget_filledmarker.h"
298
300
306class GUI_EXPORT QgsFilledMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledMarker
307{
308 Q_OBJECT
309
310 public:
311
317 QgsFilledMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
319
325
326 // from base class
327 void setSymbolLayer( QgsSymbolLayer *layer ) override;
328 QgsSymbolLayer *symbolLayer() override;
329
330 protected:
331 QgsFilledMarkerSymbolLayer *mLayer = nullptr;
332
333 private slots:
334
335 void updateAssistantSymbol();
336 void setShape();
337 void setSize();
338 void setAngle();
339 void setOffset();
340 void mSizeUnitWidget_changed();
341 void mOffsetUnitWidget_changed();
342 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
343 void mVerticalAnchorComboBox_currentIndexChanged( int index );
344
345 private:
346
347 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
348};
349
351
352#include "ui_widget_gradientfill.h"
353
355
360class GUI_EXPORT QgsGradientFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientFill
361{
362 Q_OBJECT
363
364 public:
365
371 QgsGradientFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
372
378
379 // from base class
380 void setSymbolLayer( QgsSymbolLayer *layer ) override;
381 QgsSymbolLayer *symbolLayer() override;
382
383 public slots:
384 void setColor( const QColor &color );
385 void setColor2( const QColor &color );
386
390 void applyColorRamp();
391 void setGradientType( int index );
392 void setCoordinateMode( int index );
393 void setGradientSpread( int index );
394
395 protected:
396 QgsGradientFillSymbolLayer *mLayer = nullptr;
397
398 private slots:
399 void offsetChanged();
400 void referencePointChanged();
401 void mOffsetUnitWidget_changed();
402 void colorModeChanged();
403 void mSpinAngle_valueChanged( double value );
404
405};
406
408
409#include "ui_widget_shapeburstfill.h"
410
412
417class GUI_EXPORT QgsShapeburstFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetShapeburstFill
418{
419 Q_OBJECT
420
421 public:
422
429
435
436 // from base class
437 void setSymbolLayer( QgsSymbolLayer *layer ) override;
438 QgsSymbolLayer *symbolLayer() override;
439
440 public slots:
441 void setColor( const QColor &color );
442 void setColor2( const QColor &color );
443
444 protected:
446
447 private slots:
448 void colorModeChanged();
449 void mSpinBlurRadius_valueChanged( int value );
450 void mSpinMaxDistance_valueChanged( double value );
451 void mDistanceUnitWidget_changed();
452 void mRadioUseWholeShape_toggled( bool value );
453 void applyColorRamp();
454 void offsetChanged();
455 void mOffsetUnitWidget_changed();
456 void mIgnoreRingsCheckBox_stateChanged( int state );
457};
458
460
461#include "ui_widget_markerline.h"
462
464
469class GUI_EXPORT QgsMarkerLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetMarkerLine
470{
471 Q_OBJECT
472
473 public:
474
480 QgsMarkerLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
481
487
488 // from base class
489 void setSymbolLayer( QgsSymbolLayer *layer ) override;
490 QgsSymbolLayer *symbolLayer() override;
491 void setContext( const QgsSymbolWidgetContext &context ) override;
492
493 public slots:
494
495 void setInterval( double val );
496 void setOffsetAlongLine( double val );
497
498 protected:
499
500 QgsMarkerLineSymbolLayer *mLayer = nullptr;
501
502 private slots:
503 void setRotate();
504 void setOffset();
505 void setPlacement();
506 void mIntervalUnitWidget_changed();
507 void mOffsetUnitWidget_changed();
508 void mOffsetAlongLineUnitWidget_changed();
509 void averageAngleUnitChanged();
510 void setAverageAngle( double val );
511
512};
513
514
515#include "ui_widget_hashline.h"
516
518
525class GUI_EXPORT QgsHashedLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetHashedLine
526{
527 Q_OBJECT
528
529 public:
530
536 QgsHashedLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
537
543
544 // from base class
545 void setSymbolLayer( QgsSymbolLayer *layer ) override;
546 QgsSymbolLayer *symbolLayer() override;
547 void setContext( const QgsSymbolWidgetContext &context ) override;
548
549 private slots:
550
551 void setInterval( double val );
552 void setOffsetAlongLine( double val );
553 void setHashLength( double val );
554 void setHashAngle( double val );
555
556 void setRotate();
557 void setOffset();
558 void setPlacement();
559 void mIntervalUnitWidget_changed();
560 void mOffsetUnitWidget_changed();
561 void mOffsetAlongLineUnitWidget_changed();
562 void hashLengthUnitWidgetChanged();
563 void averageAngleUnitChanged();
564 void setAverageAngle( double val );
565 private:
566 QgsHashedLineSymbolLayer *mLayer = nullptr;
567
568
569};
570
572
573#include "ui_widget_svgmarker.h"
574
576
581class GUI_EXPORT QgsSvgMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSvgMarker
582{
583 Q_OBJECT
584
585 public:
586
592 QgsSvgMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
594
600
601 // from base class
602 void setSymbolLayer( QgsSymbolLayer *layer ) override;
603 QgsSymbolLayer *symbolLayer() override;
604
605 void setContext( const QgsSymbolWidgetContext &context ) override;
606
607 public slots:
609 void setSvgPath( const QString &name );
611 void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
612
613
614 protected:
615 // TODO QGIS 4: remove
616
621 Q_DECL_DEPRECATED void populateList() SIP_DEPRECATED {}
622
629 void setGuiForSvg( const QgsSvgMarkerSymbolLayer *layer, bool skipDefaultColors = false );
630
631 QgsSvgMarkerSymbolLayer *mLayer = nullptr;
632
633 private slots:
634 void svgSourceChanged( const QString &text );
635 void mChangeColorButton_colorChanged( const QColor &color );
636 void mChangeStrokeColorButton_colorChanged( const QColor &color );
637 void mStrokeWidthSpinBox_valueChanged( double d );
638 void mSizeUnitWidget_changed();
639 void mStrokeWidthUnitWidget_changed();
640 void mOffsetUnitWidget_changed();
641 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
642 void mVerticalAnchorComboBox_currentIndexChanged( int index );
643 void setWidth();
644 void setHeight();
645 void lockAspectRatioChanged( bool locked );
646 void setAngle();
647 void setOffset();
648 void updateAssistantSymbol();
649
650 private:
651
652 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
653
654};
655
657
658#include "ui_widget_rastermarker.h"
659
661
668class GUI_EXPORT QgsRasterMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterMarker
669{
670 Q_OBJECT
671
672 public:
673
679 QgsRasterMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
680
686
687 // from base class
688 void setSymbolLayer( QgsSymbolLayer *layer ) override;
689 QgsSymbolLayer *symbolLayer() override;
690 void setContext( const QgsSymbolWidgetContext &context ) override;
691
692 protected:
693
694 QgsRasterMarkerSymbolLayer *mLayer = nullptr;
695
696 private slots:
697 void imageSourceChanged( const QString &text );
698 void mSizeUnitWidget_changed();
699 void mOffsetUnitWidget_changed();
700 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
701 void mVerticalAnchorComboBox_currentIndexChanged( int index );
702 void setWidth();
703 void setHeight();
704 void setLockAspectRatio( bool locked );
705 void setAngle();
706 void setOffset();
707 void setOpacity( double value );
708 void updatePreviewImage();
709
710};
711
712
714
715#include "ui_widget_animatedmarker.h"
716
718
725class GUI_EXPORT QgsAnimatedMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetAnimatedMarker
726{
727 Q_OBJECT
728
729 public:
730
737
743
744 // from base class
745 void setSymbolLayer( QgsSymbolLayer *layer ) override;
746 QgsSymbolLayer *symbolLayer() override;
747 void setContext( const QgsSymbolWidgetContext &context ) override;
748
749 protected:
750
752
753 private slots:
754 void imageSourceChanged( const QString &text );
755 void mSizeUnitWidget_changed();
756 void mOffsetUnitWidget_changed();
757 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
758 void mVerticalAnchorComboBox_currentIndexChanged( int index );
759 void setWidth();
760 void setHeight();
761 void setLockAspectRatio( bool locked );
762 void setAngle();
763 void setOffset();
764 void setOpacity( double value );
765 void updatePreviewImage();
766
767 private:
768
769 QMovie *mPreviewMovie = nullptr;
770
771};
772
773
775
776#include "ui_widget_rasterfill.h"
777
779
784class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterFill
785{
786 Q_OBJECT
787
788 public:
789
795 QgsRasterFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
796
802
803 // from base class
804 void setSymbolLayer( QgsSymbolLayer *layer ) override;
805 QgsSymbolLayer *symbolLayer() override;
806
807 protected:
808 QgsRasterFillSymbolLayer *mLayer = nullptr;
809
810 private slots:
811 void imageSourceChanged( const QString &text );
812 void setCoordinateMode( int index );
813 void opacityChanged( double value );
814 void offsetChanged();
815 void mOffsetUnitWidget_changed();
816 void mRotationSpinBox_valueChanged( double d );
817
818 private:
819 void updatePreviewImage();
820};
821
822
824
825#include "ui_widget_rasterline.h"
826
828
835class GUI_EXPORT QgsRasterLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetRasterLine
836{
837 Q_OBJECT
838
839 public:
840
846 QgsRasterLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
847
853
854 // from base class
855 void setSymbolLayer( QgsSymbolLayer *layer ) override;
856 QgsSymbolLayer *symbolLayer() override;
857
858 protected:
859
860 QgsRasterLineSymbolLayer *mLayer = nullptr;
861
862 private slots:
863 void imageSourceChanged( const QString &text );
864 void updatePreviewImage();
865
866};
867
868
870
871#include "ui_widget_gradientline.h"
872
874
881class GUI_EXPORT QgsLineburstSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetGradientLine
882{
883 Q_OBJECT
884
885 public:
886
892 QgsLineburstSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
893
899
900 // from base class
901 void setSymbolLayer( QgsSymbolLayer *layer ) override;
902 QgsSymbolLayer *symbolLayer() override;
903
904 protected:
905
906 QgsLineburstSymbolLayer *mLayer = nullptr;
907
908};
909
910
912
913#include "ui_widget_filledline.h"
914
916
923class GUI_EXPORT QgsFilledLineSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFilledLine
924{
925 Q_OBJECT
926
927 public:
928
934 QgsFilledLineSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
935
937
943
944 void setSymbolLayer( QgsSymbolLayer *layer ) override;
945 QgsSymbolLayer *symbolLayer() override;
946
947 private:
948
949 QgsFilledLineSymbolLayer *mLayer = nullptr;
950
951};
952
953
955
956#include "ui_widget_svgfill.h"
957
959
964class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetSVGFill
965{
966 Q_OBJECT
967
968 public:
969
975 QgsSVGFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
976
982
983 // from base class
984 void setSymbolLayer( QgsSymbolLayer *layer ) override;
985 QgsSymbolLayer *symbolLayer() override;
986 void setContext( const QgsSymbolWidgetContext &context ) override;
987
988 protected:
989 QgsSVGFillSymbolLayer *mLayer = nullptr;
990
997 void updateParamGui( bool resetValues = true );
998
999 private slots:
1000 void mTextureWidthSpinBox_valueChanged( double d );
1001 void svgSourceChanged( const QString &text );
1002 void setFile( const QString &name );
1003 void setSvgParameters( const QMap<QString, QgsProperty> &parameters );
1004 void mRotationSpinBox_valueChanged( double d );
1005 void mChangeColorButton_colorChanged( const QColor &color );
1006 void mChangeStrokeColorButton_colorChanged( const QColor &color );
1007 void mStrokeWidthSpinBox_valueChanged( double d );
1008 void mTextureWidthUnitWidget_changed();
1009 void mSvgStrokeWidthUnitWidget_changed();
1010};
1011
1013
1014#include "ui_widget_linepatternfill.h"
1015
1017
1022class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetLinePatternFill
1023{
1024 Q_OBJECT
1025
1026 public:
1027
1034
1040
1041 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1042 QgsSymbolLayer *symbolLayer() override;
1043
1044 protected:
1046
1047 private slots:
1048 void mAngleSpinBox_valueChanged( double d );
1049 void mDistanceSpinBox_valueChanged( double d );
1050 void mOffsetSpinBox_valueChanged( double d );
1051 void mDistanceUnitWidget_changed();
1052 void mOffsetUnitWidget_changed();
1053};
1054
1056
1057#include "ui_widget_pointpatternfill.h"
1058
1060
1065class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetPointPatternFill
1066{
1067 Q_OBJECT
1068
1069 public:
1070
1077
1083
1084 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1085 QgsSymbolLayer *symbolLayer() override;
1086
1087 protected:
1089
1090 private slots:
1091 void mHorizontalDistanceSpinBox_valueChanged( double d );
1092 void mVerticalDistanceSpinBox_valueChanged( double d );
1093 void mHorizontalDisplacementSpinBox_valueChanged( double d );
1094 void mVerticalDisplacementSpinBox_valueChanged( double d );
1095 void mHorizontalOffsetSpinBox_valueChanged( double d );
1096 void mVerticalOffsetSpinBox_valueChanged( double d );
1097 void mHorizontalDistanceUnitWidget_changed();
1098 void mVerticalDistanceUnitWidget_changed();
1099 void mHorizontalDisplacementUnitWidget_changed();
1100 void mVerticalDisplacementUnitWidget_changed();
1101 void mHorizontalOffsetUnitWidget_changed();
1102 void mVerticalOffsetUnitWidget_changed();
1103};
1104
1105
1107
1108#include "ui_widget_randommarkerfill.h"
1109
1111
1120class GUI_EXPORT QgsRandomMarkerFillSymbolLayerWidget: public QgsSymbolLayerWidget, private Ui::WidgetRandomMarkerFill
1121{
1122 Q_OBJECT
1123
1124 public:
1125
1132
1138
1139 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1140 QgsSymbolLayer *symbolLayer() override;
1141
1142 private:
1143 QgsRandomMarkerFillSymbolLayer *mLayer = nullptr;
1144
1145 private slots:
1146
1147 void countMethodChanged( int );
1148 void countChanged( int d );
1149 void densityAreaChanged( double d );
1150 void densityAreaUnitChanged();
1151 void seedChanged( int d );
1152};
1153
1155
1156#include "ui_widget_fontmarker.h"
1157
1159class CharacterWidget;
1160
1165class GUI_EXPORT QgsFontMarkerSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetFontMarker
1166{
1167 Q_OBJECT
1168
1169 public:
1170
1176 QgsFontMarkerSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1178
1184
1185 // from base class
1186 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1187 QgsSymbolLayer *symbolLayer() override;
1188
1189 public slots:
1190 void setFontFamily( const QFont &font );
1191 void setColor( const QColor &color );
1192
1196 void setColorStroke( const QColor &color );
1197 void setSize( double size );
1198 void setAngle( double angle );
1199
1204 void setCharacter( QChar chr );
1205
1211 void setCharacterFromText( const QString &text );
1212
1213 protected:
1214 QgsFontMarkerSymbolLayer *mLayer = nullptr;
1215 CharacterWidget *widgetChar = nullptr;
1216
1217 private slots:
1218
1223 void setFontStyle( const QString &style );
1224
1225 void setOffset();
1226 void mSizeUnitWidget_changed();
1227 void mOffsetUnitWidget_changed();
1228 void mStrokeWidthUnitWidget_changed();
1229 void mStrokeWidthSpinBox_valueChanged( double d );
1230
1231 void populateFontStyleComboBox();
1232 void mFontStyleComboBox_currentIndexChanged( int index );
1233
1234 void mHorizontalAnchorComboBox_currentIndexChanged( int index );
1235 void mVerticalAnchorComboBox_currentIndexChanged( int index );
1236 void penJoinStyleChanged();
1237 void updateAssistantSymbol();
1238
1239 private:
1240
1241 std::shared_ptr< QgsMarkerSymbol > mAssistantPreviewSymbol;
1242
1243 QFont mRefFont;
1244 QFontDatabase mFontDB;
1245
1246};
1247
1249
1250
1251#include "ui_widget_centroidfill.h"
1252
1254
1259class GUI_EXPORT QgsCentroidFillSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::WidgetCentroidFill
1260{
1261 Q_OBJECT
1262
1263 public:
1264
1270 QgsCentroidFillSymbolLayerWidget( QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
1271
1277
1278 // from base class
1279 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1280 QgsSymbolLayer *symbolLayer() override;
1281
1282 protected:
1284
1285 private slots:
1286 void mDrawInsideCheckBox_stateChanged( int state );
1287 void mDrawAllPartsCheckBox_stateChanged( int state );
1288 void mClipPointsCheckBox_stateChanged( int state );
1289 void mClipOnCurrentPartOnlyCheckBox_stateChanged( int state );
1290};
1291
1292
1294
1295#include "ui_qgslinearreferencingsymbollayerwidgetbase.h"
1296
1298
1305class GUI_EXPORT QgsLinearReferencingSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::QgsLinearReferencingSymbolLayerWidgetBase
1306{
1307 Q_OBJECT
1308
1309 public:
1310
1315
1317
1323
1324 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1325 QgsSymbolLayer *symbolLayer() override;
1326 void setContext( const QgsSymbolWidgetContext &context ) override;
1327
1328 private slots:
1329 void changeNumberFormat();
1330
1331 private:
1332
1333 QgsLinearReferencingSymbolLayer *mLayer = nullptr;
1334 bool mBlockChangesSignal = false;
1335};
1336
1337
1338#include "ui_qgsgeometrygeneratorwidgetbase.h"
1339#include "qgis_gui.h"
1340
1342
1347class GUI_EXPORT QgsGeometryGeneratorSymbolLayerWidget : public QgsSymbolLayerWidget, private Ui::GeometryGeneratorWidgetBase
1348{
1349 Q_OBJECT
1350
1351 public:
1352
1359
1364
1365 // from base class
1366 void setSymbolLayer( QgsSymbolLayer *layer ) override;
1367 QgsSymbolLayer *symbolLayer() override;
1368
1369 private:
1370 QgsGeometryGeneratorSymbolLayer *mLayer = nullptr;
1371 int mBlockSignals = 0;
1372
1373 private slots:
1374 void updateExpression( const QString &string );
1375 void updateSymbolType();
1376};
1377
1378#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.
Map canvas is a class for displaying all GIS data types on a canvas.
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