QGIS API Documentation 3.99.0-Master (26c88405ac0)
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
21#include "qgis_gui.h"
22#include "qgsstylemodel.h"
24
25#include <QWidget>
26
27class QgsSymbol;
28class QgsStyle;
29
30class QMenu;
31
37class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListWidget, private QgsExpressionContextGenerator
38{
39 Q_OBJECT
40
41 public:
42
51 QgsSymbolsListWidget( QgsSymbol *symbol, QgsStyle *style, QMenu *menu, QWidget *parent SIP_TRANSFERTHIS, QgsVectorLayer *layer = nullptr );
52
53
54 ~QgsSymbolsListWidget() override;
55
62
68
72 const QgsVectorLayer *layer() const { return mLayer; }
73
74 public slots:
75
76 void setSymbolColor( const QColor &color );
77 void setMarkerAngle( double angle );
78 void setMarkerSize( double size );
79 void setLineWidth( double width );
80
81 void clipFeaturesToggled( bool checked );
82
83 void updateDataDefinedMarkerSize();
84 void updateDataDefinedMarkerAngle();
85 void updateDataDefinedLineWidth();
86
87 signals:
88
92 void changed();
93
94 private slots:
95 void setSymbolFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
96 void mSymbolUnitWidget_changed();
97 void updateAssistantSymbol();
98 void opacityChanged( double value );
99 void createAuxiliaryField();
100 void createSymbolAuxiliaryField();
101 void forceRHRToggled( bool checked );
102 void showAnimationSettings();
103 void showExtentBufferSettings();
104 void showBufferSettings();
105 void saveSymbol();
106 void updateSymbolDataDefinedProperty();
107
108 private:
109 void registerSymbolDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbol::Property key );
110
111 QgsSymbol *mSymbol = nullptr;
112 std::shared_ptr<QgsSymbol> mAssistantSymbol;
113 QgsStyle *mStyle = nullptr;
114 QMenu *mAdvancedMenu = nullptr;
115 QAction *mClipFeaturesAction = nullptr;
116 QAction *mStandardizeRingsAction = nullptr;
117 QAction *mBufferSettingsAction = nullptr;
118 QAction *mAnimationSettingsAction = nullptr;
119 QAction *mExtentBufferAction = nullptr;
120 QgsVectorLayer *mLayer = nullptr;
121
122 QgsColorButton *mSymbolColorButton = nullptr;
123 QgsOpacityWidget *mSymbolOpacityWidget = nullptr;
124 QgsUnitSelectionWidget *mSymbolUnitWidget = nullptr;
125
126 void updateSymbolColor();
127 void updateSymbolInfo();
128 QgsSymbolWidgetContext mContext;
129
131 void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key );
132};
133
134#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.
A database of saved style entities, including symbols, color ramps, text formats and others.
Definition qgsstyle.h:88
StyleEntity
Enum for Entities involved in a style.
Definition qgsstyle.h:204
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
QgsSymbolWidgetContext context() const
Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expressi...
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
QgsSymbolsListWidget(QgsSymbol *symbol, QgsStyle *style, QMenu *menu, QWidget *parent, QgsVectorLayer *layer=nullptr)
Constructor for QgsSymbolsListWidget.
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 dataset.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53