QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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:
48 QgsSymbolsListWidget( QgsSymbol *symbol, QgsStyle *style, QMenu *menu, QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *layer = nullptr );
49
50
51 ~QgsSymbolsListWidget() override;
52
58 void setContext( const QgsSymbolWidgetContext &context );
59
64 QgsSymbolWidgetContext context() const;
65
69 const QgsVectorLayer *layer() const { return mLayer; }
70
71 public slots:
72
73 void setSymbolColor( const QColor &color );
74 void setMarkerAngle( double angle );
75 void setMarkerSize( double size );
76 void setLineWidth( double width );
77
78 void clipFeaturesToggled( bool checked );
79
80 void updateDataDefinedMarkerSize();
81 void updateDataDefinedMarkerAngle();
82 void updateDataDefinedLineWidth();
83
84 signals:
85
89 void changed();
90
91 private slots:
92 void setSymbolFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
93 void mSymbolUnitWidget_changed();
94 void updateAssistantSymbol();
95 void opacityChanged( double value );
96 void createAuxiliaryField();
97 void createSymbolAuxiliaryField();
98 void forceRHRToggled( bool checked );
99 void showAnimationSettings();
100 void showExtentBufferSettings();
101 void showBufferSettings();
102 void saveSymbol();
103 void updateSymbolDataDefinedProperty();
104
105 private:
106 void registerSymbolDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbol::Property key );
107
108 QgsSymbol *mSymbol = nullptr;
109 std::shared_ptr<QgsSymbol> mAssistantSymbol;
110 QgsStyle *mStyle = nullptr;
111 QMenu *mAdvancedMenu = nullptr;
112 QAction *mClipFeaturesAction = nullptr;
113 QAction *mStandardizeRingsAction = nullptr;
114 QAction *mBufferSettingsAction = nullptr;
115 QAction *mAnimationSettingsAction = nullptr;
116 QAction *mExtentBufferAction = nullptr;
117 QgsVectorLayer *mLayer = nullptr;
118
119 QgsColorButton *mSymbolColorButton = nullptr;
120 QgsOpacityWidget *mSymbolOpacityWidget = nullptr;
121 QgsUnitSelectionWidget *mSymbolUnitWidget = nullptr;
122
123 void updateSymbolColor();
124 void updateSymbolInfo();
125 QgsSymbolWidgetContext mContext;
126
128 void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
129};
130
131#endif //QGSSYMBOLSLISTWIDGET_H
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...
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