QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsvectorlayerlegendwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorlayerlegendwidget.h
3 ---------------------
4 Date : April 2018
5 Copyright : (C) 2018 by Martin Dobias
6 Email : wonder dot sk at gmail dot 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 QGSVECTORLAYERLEGENDWIDGET_H
17#define QGSVECTORLAYERLEGENDWIDGET_H
18
19// We don't want to expose this in the public API
20#define SIP_NO_FILE
21
22#include <QWidget>
23
24#include "qgstextformat.h"
25#include "qgis_gui.h"
26
28class QLabel;
29class QPushButton;
30class QTreeView;
31class QTreeWidget;
32class QTreeWidgetItem;
33
34class QgsFontButton;
36class QgsMapCanvas;
37class QgsVectorLayer;
38
45class GUI_EXPORT QgsVectorLayerLegendWidget : public QWidget
46{
47 Q_OBJECT
48 public:
49 explicit QgsVectorLayerLegendWidget( QWidget *parent = nullptr );
50
52 void setMapCanvas( QgsMapCanvas *canvas );
53
55 QgsMapCanvas *mapCanvas() const { return mCanvas; }
56
58 void setLayer( QgsVectorLayer *layer );
59
61 void applyToLayer();
62
63 private slots:
64 void labelsFromExpression();
65 void labelLegendTreeWidgetItemDoubleClicked( QTreeWidgetItem *item, int column );
66
67 private:
68 void populateLegendTreeView( const QHash<QString, QString> &content );
69 void populateLabelLegendTreeWidget();
70 void applyLabelLegend();
71
72 private:
73 QTreeView *mLegendTreeView = nullptr;
74 QgsFontButton *mTextOnSymbolFormatButton = nullptr;
75 QPushButton *mTextOnSymbolFromExpressionButton = nullptr;
76 QgsCollapsibleGroupBox *mTextOnSymbolGroupBox = nullptr;
77 QLabel *mTextOnSymbolLabel = nullptr;
78 QgsCollapsibleGroupBox *mLabelLegendGroupBox = nullptr;
79 QTreeWidget *mLabelLegendTreeWidget = nullptr;
80 QLabel *mPlaceholderImageLabel = nullptr;
81 QgsImageSourceLineEdit *mImageSourceLineEdit = nullptr;
82
83 QgsMapCanvas *mCanvas = nullptr;
84 QgsVectorLayer *mLayer = nullptr;
85};
86
87#endif // QGSVECTORLAYERLEGENDWIDGET_H
A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
A button for customizing QgsTextFormat settings.
A line edit widget with toolbutton for setting a raster image path.
Map canvas is a class for displaying all GIS data types on a canvas.
A widget for configuration of options specific to vector layer's legend.
QgsMapCanvas * mapCanvas() const
Returns pointer to map canvas.
Represents a vector layer which manages a vector based data sets.