Ok,
Is this code, what you mean?
world.fill(Qt::transparent);
painter.setPen(Qt::black);
painter.
setBrush(QBrush(Qt
::black));
iworld.save("C:/world.png","PNG");
QPixmap world(100,100);
QPainter painter(&world);
world.fill(Qt::transparent);
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::black));
painter.drawRect(QRectF(QPointF(0,0),QPointF(50,50)));
iworld.save("C:/world.png","PNG");
To copy to clipboard, switch view to plain text mode
while adding the "world.fill(Qt::transparent)" the whole pixmap is transparent(in the meaning of being empty)
What am I doing wrong or is there a flow in your answer?
I can set Brush as Qt::transparent and it fills the rect with no colors(that's ok), but what about the other part of the pixmap? I am currently looking for the answer.
Thanks for any further help.
Kacper
Bookmarks