Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.2
-
None
Description
Running the code below, QPainter::drawPicture() disregards the picture boundingRect () .
Setting the picture's bounding rectangle should produce the same result as using QPainter::setClipRect();
void myWidget::paintEvent(QPaintEvent* e) {
QPainter painter(this);
QPicture p1;
drawAll(&p1, 350, 350);
p1.setBoundingRect(QRect(0, 0, 350 / 2, 350 / 2));
//painter.setClipRect(0, 0, 350 /2, 350 / 2);
painter.drawPicture(20, 20, p1);
painter.end();
}
void myWidget::drawAll(QPaintDevice* paindevice, int sizeX, int sizeY){
QPainter painter(paindevice);
QColor c("white");
painter.fillRect(0, 0, sizeX, sizeY, c);
painter.setFont(QFont("Helvetica", 30, 2));
painter.drawText(130, 170, "TEST");
painter.end();
}
QPainter::drawText() doesn't update the bounding rect correctly either, as described in 253070.