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

QGraphicsSVGItem: geometry is not updated after renderer is reloaded with new SVG content

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.0
    • SVG Support
    • None
    • Linux/X11

    Description

      I load a simple SVG file with a rectangle.

      I change the DOM, setting a different width on the rectangle.

      I call the load() method on the QSvgRenderer that is shared across several items.

      width is not updated.

      The same approach (change the dom, call load() on the renderer) seems to work for other attributes (e.g. style, I am able to change the colors of the rectangle).

      A call to  renderer()->boundsOnElement(id)  before and after the width change returns a rectangle with the correct size (the width is consistent with the change)

       

      Am I missing something?

       

      One more question: why do I have to explicitly call setPos on each item after querying

      renderer()->boundsOnElement(id)

      instead of having the items automatically positioned as defined in the SVG?

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jacum Giacomo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes