QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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"
25
#include "
qgscolorramplegendnodesettings.h
"
26
27
#include <QDialog>
28
29
class
QDialogButtonBox;
30
42
class
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
83
QgsColorRampLegendNodeSettings
settings
() const;
84
90
void
setSettings
( const
QgsColorRampLegendNodeSettings
&
settings
);
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;
109
QgsColorRampLegendNodeSettings
mSettings;
110
};
111
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QgsColorRampLegendNodeWidget
::
Capabilities
)
112
118
class GUI_EXPORT
QgsColorRampLegendNodeDialog
: public QDialog
119
{
120
Q_OBJECT
121
122
public
:
128
QgsColorRampLegendNodeDialog
(
129
const
QgsColorRampLegendNodeSettings
&
settings
,
130
QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
131
QgsColorRampLegendNodeWidget::Capabilities
capabilities =
QgsColorRampLegendNodeWidget::Capability::AllCapabilities
132
);
133
137
QgsColorRampLegendNodeSettings
settings
()
const
;
138
142
QDialogButtonBox *
buttonBox
()
const
;
143
151
void
setUseContinuousRampCheckBoxVisibility
(
bool
visible );
152
153
private
:
154
QgsColorRampLegendNodeWidget
*mWidget =
nullptr
;
155
QDialogButtonBox *mButtonBox =
nullptr
;
156
};
157
158
159
#endif
//QGSCOLORRAMPLEGENDNODEWIDGET_H
QgsColorRampLegendNodeDialog::setUseContinuousRampCheckBoxVisibility
void setUseContinuousRampCheckBoxVisibility(bool visible)
Sets visibility for the "Use Continuous Legend" checkbox in the legend settings dialog to visible.
Definition
qgscolorramplegendnodewidget.cpp:202
QgsColorRampLegendNodeDialog::QgsColorRampLegendNodeDialog
QgsColorRampLegendNodeDialog(const QgsColorRampLegendNodeSettings &settings, QWidget *parent SIP_TRANSFERTHIS=nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities=QgsColorRampLegendNodeWidget::Capability::AllCapabilities)
Constructor for QgsColorRampLegendNodeDialog, initially showing the specified settings.
Definition
qgscolorramplegendnodewidget.cpp:174
QgsColorRampLegendNodeDialog::buttonBox
QDialogButtonBox * buttonBox() const
Returns a reference to the dialog's button box.
Definition
qgscolorramplegendnodewidget.cpp:197
QgsColorRampLegendNodeDialog::settings
QgsColorRampLegendNodeSettings settings() const
Returns the legend node settings as defined by the dialog.
Definition
qgscolorramplegendnodewidget.cpp:192
QgsColorRampLegendNodeSettings
Settings for a color ramp legend node.
Definition
qgscolorramplegendnodesettings.h:39
QgsColorRampLegendNodeWidget
A widget for properties relating to a QgsColorRampLegendNode (QgsColorRampLegendNodeSettings).
Definition
qgscolorramplegendnodewidget.h:43
QgsColorRampLegendNodeWidget::Capabilities
QFlags< Capability > Capabilities
Capabilities to expose in the widget.
Definition
qgscolorramplegendnodewidget.h:68
QgsColorRampLegendNodeWidget::Capability
Capability
Capabilities to expose in the widget.
Definition
qgscolorramplegendnodewidget.h:53
QgsColorRampLegendNodeWidget::Capability::AllCapabilities
@ AllCapabilities
All capabilities.
Definition
qgscolorramplegendnodewidget.h:59
QgsColorRampLegendNodeWidget::settings
QgsColorRampLegendNodeSettings settings() const
Returns the legend node settings as defined by the widget.
Definition
qgscolorramplegendnodewidget.cpp:94
QgsColorRampLegendNodeWidget::setSettings
void setSettings(const QgsColorRampLegendNodeSettings &settings)
Sets the settings to show in the widget.
Definition
qgscolorramplegendnodewidget.cpp:109
QgsColorRampLegendNodeWidget::QgsColorRampLegendNodeWidget
QgsColorRampLegendNodeWidget(QWidget *parent=nullptr, QgsColorRampLegendNodeWidget::Capabilities capabilities=QgsColorRampLegendNodeWidget::Capability::AllCapabilities)
Constructor for QgsColorRampLegendNodeWidget, with the specified parent widget.
Definition
qgscolorramplegendnodewidget.cpp:31
QgsColorRampLegendNodeWidget::setUseContinuousRampCheckBoxVisibility
void setUseContinuousRampCheckBoxVisibility(bool visible)
Sets visibility for the "Use Continuous Legend" checkbox to visible.
Definition
qgscolorramplegendnodewidget.cpp:126
QgsPanelWidget::QgsPanelWidget
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
Definition
qgspanelwidget.cpp:30
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_ENUM_BASETYPE
#define SIP_ENUM_BASETYPE(type)
Definition
qgis_sip.h:277
qgscolorramplegendnodesettings.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTimeZoneComboBox::StandardItems)
Generated on
for QGIS API Documentation by
1.17.0