Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2548

Bounding rect problem with QPicture

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.3.2
    • GUI: Painting
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes