QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsgradientcolorrampdialog.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsgradientcolorrampdialog.h
3
----------------------------
4
begin : December 2009
5
copyright : (C) 2009 by Martin Dobias
6
email : wonder dot sk at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSGRADIENTCOLORRAMPDIALOG_H
17
#define QGSGRADIENTCOLORRAMPDIALOG_H
18
19
#include "ui_qgsgradientcolorrampdialogbase.h"
20
21
#include "qgis_gui.h"
22
#include "
qgis_sip.h
"
23
#include "
qgshelp.h
"
24
25
#include <QDialog>
26
27
class
QgsGradientColorRamp
;
28
class
QgsSettingsEntryBool
;
29
class
QwtPlot;
30
class
QwtPlotCurve;
31
class
QwtPlotMarker;
32
class
QgsGradientPlotEventFilter;
33
39
class
GUI_EXPORT
QgsGradientColorRampDialog
:
public
QDialog,
private
Ui::QgsGradientColorRampDialogBase
40
{
41
Q_OBJECT
42
Q_PROPERTY(
QgsGradientColorRamp
ramp
READ
ramp
WRITE
setRamp
)
43
44
public
:
45
static
const
QgsSettingsEntryBool
*
settingsPlotHue
SIP_SKIP
;
46
static
const
QgsSettingsEntryBool
*
settingsPlotLightness
SIP_SKIP
;
47
static
const
QgsSettingsEntryBool
*
settingsPlotSaturation
SIP_SKIP
;
48
static
const
QgsSettingsEntryBool
*
settingsPlotAlpha
SIP_SKIP
;
49
55
QgsGradientColorRampDialog
(
const
QgsGradientColorRamp
&
ramp
, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
56
~QgsGradientColorRampDialog
()
override
;
57
62
QgsGradientColorRamp
ramp
()
const
{
return
mRamp; }
63
69
void
setRamp(
const
QgsGradientColorRamp
&ramp );
70
75
QDialogButtonBox *buttonBox()
const
;
76
77
signals:
78
80
void
changed
();
81
82
public
slots:
83
88
void
setColor1
(
const
QColor &color );
89
94
void
setColor2
(
const
QColor &color );
95
96
private
slots:
97
void
cboType_currentIndexChanged(
int
index );
98
void
btnInformation_pressed();
99
void
updateRampFromStopEditor();
100
void
updateColorButtons();
101
void
updateStopEditor();
102
void
selectedStopChanged(
const
QgsGradientStop
&stop );
103
void
colorWidgetChanged(
const
QColor &color );
104
void
mPositionSpinBox_valueChanged(
double
val );
105
void
mPlotHueCheckbox_toggled(
bool
checked );
106
void
mPlotLightnessCheckbox_toggled(
bool
checked );
107
void
mPlotSaturationCheckbox_toggled(
bool
checked );
108
void
mPlotAlphaCheckbox_toggled(
bool
checked );
109
void
plotMousePress( QPointF point );
110
void
plotMouseRelease( QPointF point );
111
void
plotMouseMove( QPointF point );
112
void
showHelp();
113
114
private
:
115
QgsGradientColorRamp
mRamp;
116
QwtPlotCurve *mLightnessCurve =
nullptr
;
117
QwtPlotCurve *mSaturationCurve =
nullptr
;
118
QwtPlotCurve *mHueCurve =
nullptr
;
119
QwtPlotCurve *mAlphaCurve =
nullptr
;
120
QList<QwtPlotMarker *> mMarkers;
121
QgsGradientPlotEventFilter *mPlotFilter =
nullptr
;
122
int
mCurrentPlotColorComponent = -1;
123
int
mCurrentPlotMarkerIndex = 0;
124
int
mBlockChanges = 0;
125
126
void
updatePlot();
127
void
addPlotMarker(
double
x,
double
y,
const
QColor &color,
bool
isSelected =
false
);
128
void
addMarkersForColor(
double
x,
const
QColor &color,
bool
isSelected =
false
);
129
130
// Returns TRUE if it's possible to edit direction regarding given colorSpec
131
static
bool
hasDirection( QColor::Spec colorSpec );
132
};
133
134
135
#ifndef SIP_RUN
136
//
137
// NOTE:
138
// For private only, not part of stable api or exposed to Python bindings
139
//
141
class
GUI_EXPORT QgsGradientPlotEventFilter :
public
QObject
142
{
143
Q_OBJECT
144
145
public
:
146
QgsGradientPlotEventFilter( QwtPlot *plot );
147
148
bool
eventFilter( QObject *
object
, QEvent *event )
override
;
149
150
signals:
151
152
void
mousePress( QPointF );
153
void
mouseRelease( QPointF );
154
void
mouseMove( QPointF );
155
156
private
:
157
QwtPlot *mPlot =
nullptr
;
158
QPointF mapPoint( QPointF point )
const
;
159
};
161
#endif
162
163
#endif
QgsGradientColorRampDialog::settingsPlotSaturation
static const QgsSettingsEntryBool * settingsPlotSaturation
Definition
qgsgradientcolorrampdialog.h:47
QgsGradientColorRampDialog::setColor2
void setColor2(const QColor &color)
Sets the end color for the gradient ramp.
Definition
qgsgradientcolorrampdialog.cpp:652
QgsGradientColorRampDialog::ramp
QgsGradientColorRamp ramp
Definition
qgsgradientcolorrampdialog.h:42
QgsGradientColorRampDialog::settingsPlotHue
static const QgsSettingsEntryBool * settingsPlotHue
Definition
qgsgradientcolorrampdialog.h:45
QgsGradientColorRampDialog::settingsPlotAlpha
static const QgsSettingsEntryBool * settingsPlotAlpha
Definition
qgsgradientcolorrampdialog.h:48
QgsGradientColorRampDialog::setRamp
void setRamp(const QgsGradientColorRamp &ramp)
Sets the color ramp to show in the dialog.
Definition
qgsgradientcolorrampdialog.cpp:212
QgsGradientColorRampDialog::QgsGradientColorRampDialog
QgsGradientColorRampDialog(const QgsGradientColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsGradientColorRampDialog.
Definition
qgsgradientcolorrampdialog.cpp:56
QgsGradientColorRampDialog::setColor1
void setColor1(const QColor &color)
Sets the start color for the gradient ramp.
Definition
qgsgradientcolorrampdialog.cpp:646
QgsGradientColorRampDialog::ramp
QgsGradientColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
Definition
qgsgradientcolorrampdialog.h:62
QgsGradientColorRampDialog::changed
void changed()
Emitted when the dialog settings change.
QgsGradientColorRampDialog::settingsPlotLightness
static const QgsSettingsEntryBool * settingsPlotLightness
Definition
qgsgradientcolorrampdialog.h:46
QgsGradientColorRamp
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
Definition
qgscolorrampimpl.h:131
QgsGradientStop
Represents a color stop within a QgsGradientColorRamp color ramp.
Definition
qgscolorrampimpl.h:42
QgsSettingsEntryBool
A boolean settings entry.
Definition
qgssettingsentryimpl.h:298
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
qgshelp.h
Generated on
for QGIS API Documentation by
1.17.0