QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 "ui_qgscolorramplegendnodewidgetbase.h"
23
24#include "qgis_gui.h"
26
27#include <QDialog>
28
29class QDialogButtonBox;
30
42class GUI_EXPORT QgsColorRampLegendNodeWidget : public QgsPanelWidget, private Ui::QgsColorRampLegendNodeWidgetBase
43{
44 Q_OBJECT
45
46 public:
52 enum class Capability : int SIP_ENUM_BASETYPE( IntFlag )
53 {
54 Prefix = 1 << 0,
55 Suffix = 1 << 1,
56 NumberFormat = 1 << 2,
57 DefaultMinimum = 1 << 3,
58 DefaultMaximum = 1 << 4,
59 AllCapabilities = Prefix | Suffix | NumberFormat | DefaultMinimum | DefaultMaximum,
60 };
61 Q_ENUM( Capability )
62
63
68 Q_DECLARE_FLAGS( Capabilities, Capability )
69 Q_FLAG( Capabilities )
70
76 QgsColorRampLegendNodeWidget( QWidget *parent = nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities = QgsColorRampLegendNodeWidget::Capability::AllCapabilities );
77
84
91
99 void setUseContinuousRampCheckBoxVisibility( bool visible );
100
101 private slots:
102
103 void onChanged();
104 void changeNumberFormat();
105 void onOrientationChanged();
106
107 private:
108 bool mBlockSignals = false;
110};
112
118class GUI_EXPORT QgsColorRampLegendNodeDialog : public QDialog
119{
120 Q_OBJECT
121
122 public:
129
134
138 QDialogButtonBox *buttonBox() const;
139
147 void setUseContinuousRampCheckBoxVisibility( bool visible );
148
149 private:
150 QgsColorRampLegendNodeWidget *mWidget = nullptr;
151 QDialogButtonBox *mButtonBox = nullptr;
152};
153
154
155#endif //QGSCOLORRAMPLEGENDNODEWIDGET_H
void setUseContinuousRampCheckBoxVisibility(bool visible)
Sets visibility for the "Use Continuous Legend" checkbox in the legend settings dialog to visible.
QgsColorRampLegendNodeDialog(const QgsColorRampLegendNodeSettings &settings, QWidget *parent SIP_TRANSFERTHIS=nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities=QgsColorRampLegendNodeWidget::Capability::AllCapabilities)
Constructor for QgsColorRampLegendNodeDialog, initially showing the specified settings.
QDialogButtonBox * buttonBox() const
Returns a reference to the dialog's button box.
QgsColorRampLegendNodeSettings settings() const
Returns the legend node settings as defined by the dialog.
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.
QgsColorRampLegendNodeSettings settings() const
Returns the legend node settings as defined by the widget.
void setSettings(const QgsColorRampLegendNodeSettings &settings)
Sets the settings to show in the widget.
QgsColorRampLegendNodeWidget(QWidget *parent=nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities=QgsColorRampLegendNodeWidget::Capability::AllCapabilities)
Constructor for QgsColorRampLegendNodeWidget, with the specified parent widget.
void setUseContinuousRampCheckBoxVisibility(bool visible)
Sets visibility for the "Use Continuous Legend" checkbox to visible.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:275
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsProjectionSelectionWidget::CrsOptions)