QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
qgssymbolslistwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssymbolslistwidget.h
3 ---------------------
4 begin : June 2012
5 copyright : (C) 2012 by Arunmozhi
6 email : aruntheguy at gmail.com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSSYMBOLSLISTWIDGET_H
17#define QGSSYMBOLSLISTWIDGET_H
18
19#include "ui_widget_symbolslist.h"
20
22#include "qgsstylemodel.h"
23#include <QWidget>
24#include "qgis_gui.h"
25
26class QgsSymbol;
27class QgsStyle;
28
29class QMenu;
30
35class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListWidget, private QgsExpressionContextGenerator
36{
37 Q_OBJECT
38
39 public:
40
49 QgsSymbolsListWidget( QgsSymbol *symbol, QgsStyle *style, QMenu *menu, QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *layer = nullptr );
50
51
52 ~QgsSymbolsListWidget() override;
53
59 void setContext( const QgsSymbolWidgetContext &context );
60
65 QgsSymbolWidgetContext context() const;
66
70 const QgsVectorLayer *layer() const { return mLayer; }
71
72 public slots:
73
74 void setSymbolColor( const QColor &color );
75 void setMarkerAngle( double angle );
76 void setMarkerSize( double size );
77 void setLineWidth( double width );
78
79 void clipFeaturesToggled( bool checked );
80
81 void updateDataDefinedMarkerSize();
82 void updateDataDefinedMarkerAngle();
83 void updateDataDefinedLineWidth();
84
85 signals:
86
90 void changed();
91
92 private slots:
93 void setSymbolFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
94 void mSymbolUnitWidget_changed();
95 void updateAssistantSymbol();
96 void opacityChanged( double value );
97 void createAuxiliaryField();
98 void createSymbolAuxiliaryField();
99 void forceRHRToggled( bool checked );
100 void showAnimationSettings();
101 void showBufferSettings();
102 void saveSymbol();
103 void updateSymbolDataDefinedProperty();
104
105 private:
106
107 void registerSymbolDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbol::Property key );
108
109 QgsSymbol *mSymbol = nullptr;
110 std::shared_ptr< QgsSymbol > mAssistantSymbol;
111 QgsStyle *mStyle = nullptr;
112 QMenu *mAdvancedMenu = nullptr;
113 QAction *mClipFeaturesAction = nullptr;
114 QAction *mStandardizeRingsAction = nullptr;
115 QAction *mBufferSettingsAction = nullptr;
116 QAction *mAnimationSettingsAction = nullptr;
117 QgsVectorLayer *mLayer = nullptr;
118 QgsMapCanvas *mMapCanvas = nullptr;
119
120 QgsColorButton *mSymbolColorButton = nullptr;
121 QgsOpacityWidget *mSymbolOpacityWidget = nullptr;
122 QgsUnitSelectionWidget *mSymbolUnitWidget = nullptr;
123
124 void updateSymbolColor();
125 void updateSymbolInfo();
126 QgsSymbolWidgetContext mContext;
127
129 void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
130};
131
132#endif //QGSSYMBOLSLISTWIDGET_H
133
134
135
A cross platform button subclass for selecting colors.
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...
Map canvas is a class for displaying all GIS data types on a canvas.
A widget for setting an opacity value.
A button for controlling property overrides which may apply to a widget.
StyleEntity
Enum for Entities involved in a style.
Definition qgsstyle.h:203
Property
Data definable properties.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Abstract base class for all rendered symbols.
Definition qgssymbol.h:231
Property
Data definable properties.
Definition qgssymbol.h:270
const QgsVectorLayer * layer() const
Returns the vector layer associated with the widget.
void changed()
Emitted when the symbol is modified in the widget.
A widget displaying a combobox allowing the user to choose between various display units,...
Represents a vector layer which manages a vector based data sets.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53