QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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:
50 enum class Capability : int SIP_ENUM_BASETYPE( IntFlag )
51 {
52 Prefix = 1 << 0,
53 Suffix = 1 << 1,
54 NumberFormat = 1 << 2,
55 DefaultMinimum = 1 << 3,
56 DefaultMaximum = 1 << 4,
57 AllCapabilities = Prefix | Suffix | NumberFormat | DefaultMinimum | DefaultMaximum,
58 };
59 Q_ENUM( Capability )
60
61
66 Q_DECLARE_FLAGS( Capabilities, Capability )
67 Q_FLAG( Capabilities )
68
74 QgsColorRampLegendNodeWidget( QWidget *parent = nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities = QgsColorRampLegendNodeWidget::Capability::AllCapabilities );
75
81 QgsColorRampLegendNodeSettings settings() const;
82
88 void setSettings( const QgsColorRampLegendNodeSettings &settings );
89
97 void setUseContinuousRampCheckBoxVisibility( bool visible );
98
99 private slots:
100
101 void onChanged();
102 void changeNumberFormat();
103 void onOrientationChanged();
104
105 private:
106 bool mBlockSignals = false;
108};
110
116class GUI_EXPORT QgsColorRampLegendNodeDialog : public QDialog
117{
118 Q_OBJECT
119
120 public:
127
131 QgsColorRampLegendNodeSettings settings() const;
132
136 QDialogButtonBox *buttonBox() const;
137
145 void setUseContinuousRampCheckBoxVisibility( bool visible );
146
147 private:
148 QgsColorRampLegendNodeWidget *mWidget = nullptr;
149 QDialogButtonBox *mButtonBox = nullptr;
150};
151
152
153#endif //QGSCOLORRAMPLEGENDNODEWIDGET_H
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)