QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgslegendpatchshapewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslegendpatchshapewidget.h
3 ---------------------------
4 Date : April 2020
5 Copyright : (C) 2020 Nyall Dawson
6 Email : nyall dot dawson 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 QGSLEGENDPATCHSHAPEWIDGET_H
17#define QGSLEGENDPATCHSHAPEWIDGET_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "ui_qgslegendpatchshapewidgetbase.h"
22#include "qgslegendpatchshape.h"
23#include <QDialog>
24
25class QDialogButtonBox;
26
32class GUI_EXPORT QgsLegendPatchShapeWidget : public QgsPanelWidget, private Ui::QgsLegendPatchShapeWidgetBase
33{
34 Q_OBJECT
35
36 public:
40 QgsLegendPatchShapeWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QgsLegendPatchShape &shape = QgsLegendPatchShape() );
41
47 QgsLegendPatchShape shape() const;
48
54 void setShape( const QgsLegendPatchShape &shape );
55
56 signals:
57
61 void changed();
62
63 private slots:
64 void setShapeFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
65 void saveShape();
66
67 private:
69};
70
76class GUI_EXPORT QgsLegendPatchShapeDialog : public QDialog
77{
78 Q_OBJECT
79
80 public:
84 QgsLegendPatchShapeDialog( const QgsLegendPatchShape &shape, QWidget *parent SIP_TRANSFERTHIS = nullptr );
85
89 QgsLegendPatchShape shape() const { return mWidget->shape(); }
90
94 QDialogButtonBox *buttonBox() const;
95
96 private:
97 QgsLegendPatchShapeWidget *mWidget = nullptr;
98 QDialogButtonBox *mButtonBox = nullptr;
99};
100
101#endif // QGSLEGENDPATCHSHAPEWIDGET_H
SymbolType
Symbol types.
Definition qgis.h:574
@ Fill
Fill symbol.
A dialog for configuring a custom legend patch shape.
QgsLegendPatchShape shape() const
Returns the legend patch shape defined by the dialog.
Widget for configuring a custom legend patch shape.
void changed()
Emitted whenever the patch shape defined by the widget is changed.
Represents a patch shape for use in map legends.
Base class for any widget that can be shown as a inline panel.
StyleEntity
Enum for Entities involved in a style.
Definition qgsstyle.h:203
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53