QGIS API Documentation 3.99.0-Master (26c88405ac0)
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:
47
53 enum class Capability : int SIP_ENUM_BASETYPE( IntFlag )
54 {
55 Prefix = 1 << 0,
56 Suffix = 1 << 1,
57 NumberFormat = 1 << 2,
58 DefaultMinimum = 1 << 3,
59 DefaultMaximum = 1 << 4,
60 AllCapabilities = Prefix | Suffix | NumberFormat | DefaultMinimum | DefaultMaximum,
61 };
62 Q_ENUM( Capability )
63
64
69 Q_DECLARE_FLAGS( Capabilities, Capability )
70 Q_FLAG( Capabilities )
71
77 QgsColorRampLegendNodeWidget( QWidget *parent = nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities = QgsColorRampLegendNodeWidget::Capability::AllCapabilities );
78
85
92
100 void setUseContinuousRampCheckBoxVisibility( bool visible );
101
102 private slots:
103
104 void onChanged();
105 void changeNumberFormat();
106 void onOrientationChanged();
107
108 private:
109 bool mBlockSignals = false;
111};
113
119class GUI_EXPORT QgsColorRampLegendNodeDialog : public QDialog
120{
121 Q_OBJECT
122
123 public:
124
131
136
140 QDialogButtonBox *buttonBox() const;
141
149 void setUseContinuousRampCheckBoxVisibility( bool visible );
150
151 private:
152 QgsColorRampLegendNodeWidget *mWidget = nullptr;
153 QDialogButtonBox *mButtonBox = nullptr;
154};
155
156
157#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)