GradientStopModel
The stops of a color gradient, as a Qt list model — rendering-revamp §RVG-2.
| Inherits | QAbstractListModel |
| Inherited By | paint::SpectralGradientModel and RgbaGradientModel |
Declared in src/libs/libwidgets/components/GradientStopModel.hpp.
Detailed description
One row per stop, sorted by position. The model keeps the first stop at 0 and the last at 1, and the positions strictly increasing. The color type is the subclass's: libpaint's SpectralGradientModel holds spectra, RgbaGradientModel holds 8-bit sRGB with alpha. The view needs only a color to draw, which DisplayColorRole and displayColorAt() give, so GradientTrackWidget works over either.
A subclass implements the six virtual functions below and calls the begin/end row functions of QAbstractItemModel around a change of rows, and emitStopsChanged() after any change.