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

polyline is not updated when "points" attribute changes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.14.1
    • SVG Support
    • None
    • Qt SVG. Linux Qt 5.14.1
    • Linux/X11

    Description

      Example:

      <svg:polyline id="poly" item="true" points="0,0 100,100" style="fill:none;stroke:#000000" />

      when the "points" attribute is changed (e.g. add another point), the following code:

       

      QSvgRenderer *renderer = findChild<QSvgRenderer *>();

      // reload DOM containing new polyline "points"

      renderer->load(d->m_dom->getDocument().toString().toLatin1());

      item->update();

       

      does not correctly redraw the polyline, although the  

      renderer->boundsOnElement(item->elementId());

      returns a rectangle with seemingly updated position and dimensions.

       

      WORKAROUND: every time an attribute changes the geometry of the item, delete the item,

      create a new one and setSharedRenderer on it, with the same renderer, after loading the new DOM as in the code above.

       

      NOTES:

      1. Removing the  QGraphicsItem::ItemClipsToShape does not help.

      2. Even when the "points" attribute changes the points without affecting the former bounds there are drawing artifacts on the same item rectangle.

      3. Tried with all combinations of item->update()  scene->update() 

       

      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:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes