void DkGradient::init() { clearAllSliders(); addSlider(0, Qt::black); addSlider(1, Qt::white); updateGradient(); };
void DkGradient::init() { isActiveSliderExisting = false; clearAllSliders(); addSlider(0, Qt::black); addSlider(1, Qt::white); updateGradient(); };
void DkGradient::setGradient(const QLinearGradient& gradient) { reset(); clearAllSliders(); // reset adds a slider at the start and end this->gradient.setStops(gradient.stops()); QVector<QGradientStop> stops = gradient.stops(); for (int idx = 0; idx < stops.size(); idx++) { addSlider(stops.at(idx).first, stops.at(idx).second); } updateGradient(); update(); emit gradientChanged(); }