PDA

View Full Version : QPen brush doesn't follow transformations



Mercurio
3rd July 2007, 01:08
Hello all, this is my first post here :o

If I use a gradient brush to fill strokes, the gradient doesn't follow any transformation.

For example:


...
p->rotate(m_rotation);
QLinearGradient lg=QLinearGradient(QPointF(0,0),QPointF(200,200));
lg.setColorAt(1,Qt::transparent);
lg.setColorAt(0,Qt::black);
QPen gp = QPen(Qt::black, 20, Qt::SolidLine, Qt::SquareCap,Qt::RoundJoin);
gp.setBrush(QBrush(lg));
p->setPen(gp);
p->drawRect(0,0,200,200);
...


Instead, it works correctly if I use gradients to fill shapes.

Is this a bug or a feature?
(I'm using qt 4.3)

wysota
3rd July 2007, 07:40
Could be a bug. Did you check the task tracker? Does the same happen if you use a pixmap instead of a gradient?

Mercurio
3rd July 2007, 08:38
Thanks wysota, I found a similar bug on the task traker
http://trolltech.com/developer/task-tracker/index_html?method=entry&id=129520

btw using pixmaps there is the same problem.