本文整理汇总了C++中QtGradientStop::color方法的典型用法代码示例。如果您正苦于以下问题:C++ QtGradientStop::color方法的具体用法?C++ QtGradientStop::color怎么用?C++ QtGradientStop::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtGradientStop
的用法示例。
在下文中一共展示了QtGradientStop::color方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupMove
void QtGradientStopsWidgetPrivate::setupMove(QtGradientStop *stop, int x)
{
m_model->setCurrentStop(stop);
int viewportX = qRound(toViewport(stop->position()));
m_moveOffset = x - viewportX;
QList<QtGradientStop *> stops = m_stops;
m_stops.clear();
QListIterator<QtGradientStop *> itStop(stops);
while (itStop.hasNext()) {
QtGradientStop *s = itStop.next();
if (m_model->isSelected(s) || s == stop) {
m_moveStops[s] = s->position() - stop->position();
m_stops.append(s);
} else {
m_moveOriginal[s->position()] = s->color();
}
}
itStop.toFront();
while (itStop.hasNext()) {
QtGradientStop *s = itStop.next();
if (!m_model->isSelected(s))
m_stops.append(s);
}
m_stops.removeAll(stop);
m_stops.prepend(stop);
}
示例2: gradientStops
QGradientStops QtGradientStopsController::gradientStops() const
{
QGradientStops stops;
QList<QtGradientStop *> stopsList = d_ptr->m_model->stops().values();
QListIterator<QtGradientStop *> itStop(stopsList);
while (itStop.hasNext()) {
QtGradientStop *stop = itStop.next();
stops << QPair<qreal, QColor>(stop->position(), stop->color());
}
return stops;
}
示例3: while
QtGradientStopsControllerPrivate::PositionColorMap QtGradientStopsControllerPrivate::stopsData(const PositionStopMap &stops) const
{
PositionColorMap data;
PositionStopMap::ConstIterator itStop = stops.constBegin();
while (itStop != stops.constEnd()) {
QtGradientStop *stop = itStop.value();
data[stop->position()] = stop->color();
++itStop;
}
return data;
}
示例4: stopAt
QtGradientStop *QtGradientStopsWidgetPrivate::newStop(const QPoint &viewportPos)
{
QtGradientStop *copyStop = stopAt(viewportPos);
double posX = fromViewport(viewportPos.x());
QtGradientStop *stop = m_model->at(posX);
if (!stop) {
QColor newColor;
if (copyStop)
newColor = copyStop->color();
else
newColor = m_model->color(posX);
if (!newColor.isValid())
newColor = Qt::white;
stop = m_model->addStop(posX, newColor);
}
return stop;
}
示例5: slotChangeHue
void QtGradientStopsControllerPrivate::slotChangeHue(const QColor &color)
{
QtGradientStop *stop = m_model->currentStop();
if (!stop)
return;
m_model->changeStop(stop, color);
QList<QtGradientStop *> stops = m_model->selectedStops();
QListIterator<QtGradientStop *> itStop(stops);
while (itStop.hasNext()) {
QtGradientStop *s = itStop.next();
if (s != stop) {
QColor c = s->color();
if (m_ui->hsvRadioButton->isChecked())
c.setHsvF(color.hueF(), c.saturationF(), c.valueF(), c.alphaF());
else
c.setRgbF(color.redF(), c.greenF(), c.blueF(), c.alphaF());
m_model->changeStop(s, c);
}
}
}