QGIS API Documentation 4.3.0-Master (eb72899e5dc)
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 "ui_qgslegendpatchshapewidgetbase.h"
20
21#include "qgis.h"
22#include "qgis_gui.h"
23#include "qgslegendpatchshape.h"
24
25#include <QDialog>
26
27class QDialogButtonBox;
28
34class GUI_EXPORT QgsLegendPatchShapeWidget : public QgsPanelWidget, private Ui::QgsLegendPatchShapeWidgetBase
35{
36 Q_OBJECT
37
38 public:
43
50
56 void setShape( const QgsLegendPatchShape &shape );
57
58 private slots:
59 void setShapeFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
60 void saveShape();
61
62 private:
64};
65
71class GUI_EXPORT QgsLegendPatchShapeDialog : public QDialog
72{
73 Q_OBJECT
74
75 public:
79 QgsLegendPatchShapeDialog( const QgsLegendPatchShape &shape, QWidget *parent SIP_TRANSFERTHIS = nullptr );
80
84 QgsLegendPatchShape shape() const { return mWidget->shape(); }
85
89 QDialogButtonBox *buttonBox() const;
90
91 private:
92 QgsLegendPatchShapeWidget *mWidget = nullptr;
93 QDialogButtonBox *mButtonBox = nullptr;
94};
95
96#endif // QGSLEGENDPATCHSHAPEWIDGET_H
SymbolType
Symbol types.
Definition qgis.h:671
@ Fill
Fill symbol.
Definition qgis.h:674
QgsLegendPatchShape shape() const
Returns the legend patch shape defined by the dialog.
QgsLegendPatchShapeDialog(const QgsLegendPatchShape &shape, QWidget *parent=nullptr)
Constructor for QgsLegendPatchShapeDialog, initially showing the specified shape.
Widget for configuring a custom legend patch shape.
QgsLegendPatchShape shape() const
Returns the legend patch shape as currently defined by the widget.
QgsLegendPatchShapeWidget(QWidget *parent=nullptr, const QgsLegendPatchShape &shape=QgsLegendPatchShape())
Constructor for QgsLegendPatchShapeWidget, with the specified parent widget.
void setShape(const QgsLegendPatchShape &shape)
Sets the shape to show in the widget.
Represents a patch shape for use in map legends.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
StyleEntity
Enum for Entities involved in a style.
Definition qgsstyle.h:206
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52