#include <colorrampcombobox.h>
◆ ColorRampComboBox()
| ColorRampComboBox::ColorRampComboBox |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
◆ ~ColorRampComboBox()
| ColorRampComboBox::~ColorRampComboBox |
( |
| ) |
|
|
overridedefault |
◆ currentIsCustom()
| bool ColorRampComboBox::currentIsCustom |
( |
| ) |
const |
True when the current selection is a user-authored (custom) ramp rather than a built-in. Consumers that persist ramps by NAME must check this and store the full payload instead — builtin-name lookup degrades unknown names to grayscale.
◆ currentRamp()
Currently-selected ramp (built-in or user-custom). Returns RasterColorRamp::grayscale() when the "Edit Custom Ramp…" sentinel row is the active selection.
◆ customRampSaved
| void ColorRampComboBox::customRampSaved |
( |
const QString & |
name, |
|
|
const RasterColorRamp & |
ramp |
|
) |
| |
|
signal |
Emitted after the user saves a new ramp from the editor dialog (Edit Custom Ramp…). The new ramp is appended to the combo and also persisted to PreferencesManager.
◆ ensureRampSelected()
| void ColorRampComboBox::ensureRampSelected |
( |
const QString & |
name, |
|
|
const RasterColorRamp & |
ramp |
|
) |
| |
Select the ramp named name; when no row carries that name (a custom ramp authored on another machine, or one since deleted from the preferences library) a transient "custom" row is inserted from the supplied payload so the swatch and selection stay truthful.
◆ paintEvent()
| void ColorRampComboBox::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotected |
Slice S4 — override the QComboBox default text-only closed state so the gradient swatch keeps rendering after selection. QGIS / ArcGIS Pro idiom.
◆ rampChanged
Emitted whenever the user picks a ramp from the dropdown. Not emitted for the "Edit Custom Ramp…" sentinel — for that case customRampSaved fires after the editor dialog returns.
◆ rebuildItems()
| void ColorRampComboBox::rebuildItems |
( |
| ) |
|
◆ setCurrentRampByName()
| void ColorRampComboBox::setCurrentRampByName |
( |
const QString & |
name | ) |
|
Selects the first item whose ramp matches name (case-insensitive, matched against built-in display names and against user-ramp labels). No-op when no item matches.
The documentation for this class was generated from the following files: