QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 signals:
59
63 void changed();
64
65 private slots:
66 void setShapeFromStyle( const QString &name, QgsStyle::StyleEntity type, const QString &stylePath );
67 void saveShape();
68
69 private:
71};
72
78class GUI_EXPORT QgsLegendPatchShapeDialog : public QDialog
79{
80 Q_OBJECT
81
82 public:
86 QgsLegendPatchShapeDialog( const QgsLegendPatchShape &shape, QWidget *parent SIP_TRANSFERTHIS = nullptr );
87
91 QgsLegendPatchShape shape() const { return mWidget->shape(); }
92
96 QDialogButtonBox *buttonBox() const;
97
98 private:
99 QgsLegendPatchShapeWidget *mWidget = nullptr;
100 QDialogButtonBox *mButtonBox = nullptr;
101};
102
103#endif // QGSLEGENDPATCHSHAPEWIDGET_H
SymbolType
Symbol types.
Definition qgis.h:610
@ Fill
Fill symbol.
Definition qgis.h:613
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.
void changed()
Emitted whenever the patch shape defined by the widget is changed.
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:204
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53