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

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

XMLWordPrintable

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

      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?

       

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

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

              Created:
              Updated:

                There are no open Gerrit changes