Originally Posted by
yeye_olive
If you RTFM of QPainter::drawRect(), you will see that it uses the current pen and the current brush. The pen is what controls how the border is drawn. Just set the appropriate pen, then.
Thanks for the reply,
I have just written the below LOC for setting the width of the QPen just before the QRect,
QPen pen
=reportPainter.
pen();
pen.setWidth(0);
reportPainter.setPen(pen);
//DRAWING RECTANGLE ON THE PDF
reportPainter.drawRect(rect );
reportPainter.drawText(rect , Qt::AlignCenter | Qt::TextWordWrap, "SOME TEXT INSIDE");
QPen pen=reportPainter.pen();
pen.setWidth(0);
reportPainter.setPen(pen);
//DRAWING RECTANGLE ON THE PDF
QRect rect = QRect(0,50,30,20);
reportPainter.drawRect(rect );
reportPainter.drawText(rect , Qt::AlignCenter | Qt::TextWordWrap, "SOME TEXT INSIDE");
To copy to clipboard, switch view to plain text mode
But this isn't helping. It is drawing the rectangle with the same width (as it was before writing above LOC for setting the width of QPen).
Bookmarks