Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QGradient::setColorAt ( qreal  position,
const QColor color 
) [inherited]

Creates a stop point at the given position with the given color. The given position must be in the range 0 to 1.

See also:
setStops(), stops()

Definition at line 1324 of file qbrush.cpp.

References QVector< T >::at(), QVector< T >::insert(), QGradient::QGradientStop(), and QVector< T >::size().

Referenced by Window::brushChanged(), MyClass::createImage(), GraphWidget::drawBackground(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QCommonStyle::drawControl(), QGtkStyle::drawPrimitive(), QWindowsCEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), ArthurStyle::drawPrimitive(), Helper::Helper(), PaintArea::mousePressEvent(), Node::paint(), QT_BEGIN_NAMESPACE::PageItem::paint(), PaintWidget::paintEvent(), RenderArea::paintEvent(), QDesignerMenu::paintEvent(), QDesignerMenuBar::paintEvent(), MainWindow::paintEvent(), QtGradientStopsWidget::paintEvent(), and QGradient::setStops().

{
    if (pos > 1 || pos < 0) {
        qWarning("QGradient::setColorAt: Color position must be specified in the range 0 to 1");
        return;
    }

    int index = 0;
    while (index < m_stops.size() && m_stops.at(index).first < pos) ++index;

    if (index < m_stops.size() && m_stops.at(index).first == pos)
        m_stops[index].second = color;
    else
        m_stops.insert(index, QGradientStop(pos, color));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index