QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgscolorramplegendnodewidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscolorramplegendnodewidget.h
3 -----------------------
4 begin : December 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSCOLORRAMPLEGENDNODEWIDGET_H
19#define QGSCOLORRAMPLEGENDNODEWIDGET_H
20
21
22#include "qgis_gui.h"
23#include "ui_qgscolorramplegendnodewidgetbase.h"
25#include <QDialog>
26
27class QDialogButtonBox;
28
40class GUI_EXPORT QgsColorRampLegendNodeWidget: public QgsPanelWidget, private Ui::QgsColorRampLegendNodeWidgetBase
41{
42 Q_OBJECT
43
44 public:
45
51 enum class Capability : int SIP_ENUM_BASETYPE( IntFlag )
52 {
53 Prefix = 1 << 0,
54 Suffix = 1 << 1,
55 NumberFormat = 1 << 2,
56 DefaultMinimum = 1 << 3,
57 DefaultMaximum = 1 << 4,
58 AllCapabilities = Prefix | Suffix | NumberFormat | DefaultMinimum | DefaultMaximum,
59 };
60 Q_ENUM( Capability )
61
62
67 Q_DECLARE_FLAGS( Capabilities, Capability )
68 Q_FLAG( Capabilities )
69
75 QgsColorRampLegendNodeWidget( QWidget *parent = nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities = QgsColorRampLegendNodeWidget::Capability::AllCapabilities );
76
82 QgsColorRampLegendNodeSettings settings() const;
83
89 void setSettings( const QgsColorRampLegendNodeSettings &settings );
90
98 void setUseContinuousRampCheckBoxVisibility( bool visible );
99
100 private slots:
101
102 void onChanged();
103 void changeNumberFormat();
104 void onOrientationChanged();
105
106 private:
107
108 bool mBlockSignals = false;
110
111};
113
119class GUI_EXPORT QgsColorRampLegendNodeDialog : public QDialog
120{
121 Q_OBJECT
122
123 public:
124
131
135 QgsColorRampLegendNodeSettings settings() const;
136
140 QDialogButtonBox *buttonBox() const;
141
149 void setUseContinuousRampCheckBoxVisibility( bool visible );
150
151 private:
152
153 QgsColorRampLegendNodeWidget *mWidget = nullptr;
154 QDialogButtonBox *mButtonBox = nullptr;
155
156};
157
158
159#endif //QGSCOLORRAMPLEGENDNODEWIDGET_H
160
A dialog for configuring a QgsColorRampLegendNode (QgsColorRampLegendNodeSettings).
Settings for a color ramp legend node.
A widget for properties relating to a QgsColorRampLegendNode (QgsColorRampLegendNodeSettings).
QFlags< Capability > Capabilities
Capabilities to expose in the widget.
Capability
Capabilities to expose in the widget.
Base class for any widget that can be shown as a inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:278
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)