QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
vector
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
21
#include "qgis_gui.h"
22
#include "
qgstextformat.h
"
23
24
#include <QWidget>
25
26
#define SIP_NO_FILE
27
28
class
QgsImageSourceLineEdit
;
29
class
QLabel;
30
class
QPushButton;
31
class
QTreeView;
32
class
QTreeWidget;
33
class
QTreeWidgetItem;
34
class
QCheckBox;
35
36
class
QgsFontButton
;
37
class
QgsCollapsibleGroupBox
;
38
class
QgsMapCanvas
;
39
class
QgsVectorLayer
;
40
47
class
GUI_EXPORT
QgsVectorLayerLegendWidget
:
public
QWidget
48
{
49
Q_OBJECT
50
public
:
51
explicit
QgsVectorLayerLegendWidget
( QWidget *parent =
nullptr
);
52
54
void
setMapCanvas
(
QgsMapCanvas
*canvas );
55
57
QgsMapCanvas
*
mapCanvas
()
const
{
return
mCanvas; }
58
60
void
setLayer(
QgsVectorLayer
*layer );
61
63
void
applyToLayer();
64
65
private
slots:
66
void
labelsFromExpression();
67
void
labelLegendTreeWidgetItemDoubleClicked( QTreeWidgetItem *item,
int
column );
68
69
private
:
70
void
populateLegendTreeView(
const
QHash<QString, QString> &content );
71
void
populateLabelLegendTreeWidget();
72
void
applyLabelLegend();
73
74
private
:
75
QCheckBox *mIncludeByDefaultInLayoutLegendsCheck =
nullptr
;
76
QTreeView *mLegendTreeView =
nullptr
;
77
QgsFontButton
*mTextOnSymbolFormatButton =
nullptr
;
78
QPushButton *mTextOnSymbolFromExpressionButton =
nullptr
;
79
QgsCollapsibleGroupBox
*mTextOnSymbolGroupBox =
nullptr
;
80
QgsCollapsibleGroupBox
*mLabelLegendGroupBox =
nullptr
;
81
QTreeWidget *mLabelLegendTreeWidget =
nullptr
;
82
QLabel *mPlaceholderImageLabel =
nullptr
;
83
QgsImageSourceLineEdit
*mImageSourceLineEdit =
nullptr
;
84
85
QgsMapCanvas
*mCanvas =
nullptr
;
86
QgsVectorLayer
*mLayer =
nullptr
;
87
};
88
89
#endif
// QGSVECTORLAYERLEGENDWIDGET_H
QgsCollapsibleGroupBox
A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
Definition
qgscollapsiblegroupbox.h:196
QgsFontButton
A button for customizing QgsTextFormat settings.
Definition
qgsfontbutton.h:48
QgsImageSourceLineEdit
A line edit widget with toolbutton for setting a raster image path.
Definition
qgsfilecontentsourcelineedit.h:271
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsVectorLayerLegendWidget::mapCanvas
QgsMapCanvas * mapCanvas() const
Returns pointer to map canvas.
Definition
qgsvectorlayerlegendwidget.h:57
QgsVectorLayerLegendWidget::QgsVectorLayerLegendWidget
QgsVectorLayerLegendWidget(QWidget *parent=nullptr)
Definition
qgsvectorlayerlegendwidget.cpp:39
QgsVectorLayerLegendWidget::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets pointer to map canvas.
Definition
qgsvectorlayerlegendwidget.cpp:120
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgstextformat.h
Generated on
for QGIS API Documentation by
1.17.0