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

QPainter::drawText doesn't set boundingRect when pen style is Qt::NoPen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.8.0
    • GUI: Painting
    • None
    • Linux Arch

    Description

      QPainter::drawText(..., boundingRect) doesn't set boundingRect if the style of the painter is set to Qt::NoPen. This is due to an early exit test at the beginning of the function. Depending on the semantic of the function, I think boundingRect should be set either to the size of the bounding rectangle if a solid pen were used (what I would expect) or a null size rectangle. Note that drawText is used by QPainter::boundingRect(...) to calculate the returned rectangle.

      Test case attached.

      Attachments

        Activity

          People

            sletta Gunnar Sletta
            mbeniamino Matteo Beniamino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: