Example #1
0
KShape *RectangleShapeFactory::createDefaultShape(KResourceManager *) const
{
    RectangleShape *rect = new RectangleShape();

    rect->setBorder(new KLineBorder(1.0));
    rect->setShapeId(KoPathShapeId);

    QLinearGradient *gradient = new QLinearGradient(QPointF(0,0), QPointF(1,1));
    gradient->setCoordinateMode(QGradient::ObjectBoundingMode);

    gradient->setColorAt(0.0, Qt::white);
    gradient->setColorAt(1.0, Qt::green);
    rect->setBackground(new KGradientBackground(gradient));

    return rect;
}