Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.14.1
-
None
-
Qt SVG. Linux Qt 5.14.1
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()