#include <QCoreApplication>
#include <QtSvg/QSvgGenerator>
#include <QLinearGradient>
#include <QPainter>
#include <QPen>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    QSvgGenerator svg;
    svg.setFileName("svgtest.svg");
    svg.setSize(QSize(100, 100));
    svg.setViewBox(QRectF(0, 0, 100, 100));

    QPainter painter(&svg);
    QLinearGradient grad(0.0f, 0.0f, 0.0f, 50.0f);
    grad.setColorAt(0.0f, Qt::blue);
    grad.setColorAt(1.0f, Qt::white);

    QPen scalePen(grad, 2);
    painter.setPen(scalePen);
    painter.scale(1.337, 1.337);
    painter.drawLine(QPointF(0, 0), QPointF(100, 100));
    painter.end();
    return 0;
}
