16#ifndef QGSGRADIENTCOLORRAMPDIALOG_H
17#define QGSGRADIENTCOLORRAMPDIALOG_H
19#include "ui_qgsgradientcolorrampdialogbase.h"
32class QgsGradientPlotEventFilter;
75 QDialogButtonBox *buttonBox()
const;
97 void cboType_currentIndexChanged(
int index );
98 void btnInformation_pressed();
99 void updateRampFromStopEditor();
100 void updateColorButtons();
101 void updateStopEditor();
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 );
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;
127 void addPlotMarker(
double x,
double y,
const QColor &color,
bool isSelected =
false );
128 void addMarkersForColor(
double x,
const QColor &color,
bool isSelected =
false );
131 static bool hasDirection( QColor::Spec colorSpec );
141class GUI_EXPORT QgsGradientPlotEventFilter :
public QObject
146 QgsGradientPlotEventFilter( QwtPlot *plot );
148 bool eventFilter( QObject *
object, QEvent *event )
override;
152 void mousePress( QPointF );
153 void mouseRelease( QPointF );
154 void mouseMove( QPointF );
157 QwtPlot *mPlot =
nullptr;
158 QPointF mapPoint( QPointF point )
const;
static const QgsSettingsEntryBool * settingsPlotSaturation
void setColor2(const QColor &color)
Sets the end color for the gradient ramp.
QgsGradientColorRamp ramp
static const QgsSettingsEntryBool * settingsPlotHue
static const QgsSettingsEntryBool * settingsPlotAlpha
void setRamp(const QgsGradientColorRamp &ramp)
Sets the color ramp to show in the dialog.
QgsGradientColorRampDialog(const QgsGradientColorRamp &ramp, QWidget *parent=nullptr)
Constructor for QgsGradientColorRampDialog.
void setColor1(const QColor &color)
Sets the start color for the gradient ramp.
QgsGradientColorRamp ramp() const
Returns a color ramp representing the current settings from the dialog.
void changed()
Emitted when the dialog settings change.
static const QgsSettingsEntryBool * settingsPlotLightness
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
Represents a color stop within a QgsGradientColorRamp color ramp.
A boolean settings entry.