QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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
27
class
QDialogButtonBox;
28
34
class
GUI_EXPORT
QgsLegendPatchShapeWidget
:
public
QgsPanelWidget
,
private
Ui::QgsLegendPatchShapeWidgetBase
35
{
36
Q_OBJECT
37
38
public
:
42
QgsLegendPatchShapeWidget
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
const
QgsLegendPatchShape
&
shape
=
QgsLegendPatchShape
() );
43
49
QgsLegendPatchShape
shape
()
const
;
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
:
63
Qgis::SymbolType
mType =
Qgis::SymbolType::Fill
;
64
};
65
71
class
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
Qgis::SymbolType
SymbolType
Symbol types.
Definition
qgis.h:671
Qgis::SymbolType::Fill
@ Fill
Fill symbol.
Definition
qgis.h:674
QgsLegendPatchShapeDialog::shape
QgsLegendPatchShape shape() const
Returns the legend patch shape defined by the dialog.
Definition
qgslegendpatchshapewidget.h:84
QgsLegendPatchShapeDialog::QgsLegendPatchShapeDialog
QgsLegendPatchShapeDialog(const QgsLegendPatchShape &shape, QWidget *parent=nullptr)
Constructor for QgsLegendPatchShapeDialog, initially showing the specified shape.
Definition
qgslegendpatchshapewidget.cpp:118
QgsLegendPatchShapeWidget
Widget for configuring a custom legend patch shape.
Definition
qgslegendpatchshapewidget.h:35
QgsLegendPatchShapeWidget::shape
QgsLegendPatchShape shape() const
Returns the legend patch shape as currently defined by the widget.
Definition
qgslegendpatchshapewidget.cpp:47
QgsLegendPatchShapeWidget::QgsLegendPatchShapeWidget
QgsLegendPatchShapeWidget(QWidget *parent=nullptr, const QgsLegendPatchShape &shape=QgsLegendPatchShape())
Constructor for QgsLegendPatchShapeWidget, with the specified parent widget.
Definition
qgslegendpatchshapewidget.cpp:28
QgsLegendPatchShapeWidget::setShape
void setShape(const QgsLegendPatchShape &shape)
Sets the shape to show in the widget.
Definition
qgslegendpatchshapewidget.cpp:53
QgsLegendPatchShape
Represents a patch shape for use in map legends.
Definition
qgslegendpatchshape.h:34
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
QgsStyle::StyleEntity
StyleEntity
Enum for Entities involved in a style.
Definition
qgsstyle.h:206
qgis.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgslegendpatchshape.h
Generated on
for QGIS API Documentation by
1.17.0